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

Re: Date math

From: T. Ravindran <ravi_at_oil.asm.nic.in>
Date: Thu, 27 Jul 2000 20:04:42 -0700
Message-Id: <10569.112960@fatcity.com>


Try

SELECT * FROM MR_PURCHASED_ITEMS
WHERE PI_ORDER_DATE <= SYSDATE -7 ;

Ravindran.

> 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 Thu Jul 27 2000 - 22:04:42 CDT

Original text of this message

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