Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Date math
I might be missing something in your post but wouldn't this work:
SELECT *
FROM MR_PURCHASED_ITEMS
WHERE PI_ORDER_DATE < TRUNC(SYSDATE)-7;
Hth, Jim
-----Original Message-----
From: Linda Hagedorn <Linda_at_pets.com>
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
Date: Tuesday, July 25, 2000 5:42 PM
Subject: Date math
>The following SQL is selecting data older than one month ago. I need to
>change it to select data older than 7 days ago. Does anyone know the
>TO_CHAR(TO_DATE(SYSDATE etc. syntax to calculate a date of seven days
>ago?
>
> SELECT * FROM MR_PURCHASED_ITEMS
> WHERE PI_ORDER_DATE <= ADD_MONTHS(SYSDATE,-1) ;
>
>Any information is appreciated.
>
>Thanks,
>
>Linda
>
>
>
>
>--
>Author: Linda Hagedorn
> INET: Linda_at_pets.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 Jul 25 2000 - 19:48:35 CDT