Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Date math and TRUNC(SYSDATE).

RE: Date math and TRUNC(SYSDATE).

From: <Yosi_at_comhill.com>
Date: Tue, 1 Aug 2000 10:40:09 -0400
Message-Id: <10576.113505@fatcity.com>


Rich,

Is it possible that sysdate - 8 and 9 days were weekend days and there's no activity reported because there was no activity performed?

HTH, Yosi

> -----Original Message-----
> From: Jesse, Rich [mailto:Rich.Jesse_at_qtiworld.com]
> Sent: Monday, July 31, 2000 7:25 PM
> To: Multiple recipients of list ORACLE-L
> Subject: Date math and TRUNC(SYSDATE).
>
>
> So, there I was, cleaning up the usual garbage out of SYS.AUD$ when I
> decided to check my work. Hmmm...instead of deleting
> garbage older than a
> week, it was only deleting rows older than 10 days. Here's a snip:
>
> DELETE FROM AUD$
> WHERE TIMESTAMP# < TRUNC(SYSDATE) - 7
> AND ACTION# = 85
> AND USERID = 'JOE_DB_USER'
> AND SPARE1 = 'joeosusr';
>
> I remedied the problem by moving the parens of the TRUNC to
> include the "7"
> days, like this:
>
> WHERE TIMESTAMP# < TRUNC(SYSDATE - 7)
>
> ...and all seems well. Now, I just need to know why! My
> guess is that I
> was running into some typecasting problems with the TRUNC'd
> date subtracting
> 7, but I couldn't seem to find any info on it anywhere.
>
> Any takers?
>
> Rich Jesse System/Database Administrator
> Rich.Jesse_at_qtiworld.com QTI -- Sussex, WI USA
>
>
> --------------------------------------------------------------
> ----------
>
> This message has been scanned for viruses with Trend Micro's
> Interscan VirusWall.
> --
> Author: Jesse, Rich
> INET: Rich.Jesse_at_qtiworld.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
Received on Tue Aug 01 2000 - 09:40:09 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US