Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: oracle question to get Date minus 1
pawan_test wrote:
> can anyone also please suggest me for the following
>
> this is oracle question
>
> say TIME=20060928
> desired output: 20060927
>
> say TIME=20061001
> DESIRED output: 20060930
>
> If i substract one day from 'TIME' i am looking for previous day.
>
> can anyone please suggest me how do i do this is SQL.
>
> thanks
> mark
>
Just subtract 1 from the date value. For instance, if the date value is stored in the column MY_DATE, then do the following:
SELECT my_date-1 FROM my_table;
The above will subtract 1 day from the date value.
HTH,
Brian
-- =================================================================== Brian Peasland dba_at_nospam.peasland.net http://www.peasland.net Remove the "nospam." from the email address to email me. "I can give it to you cheap, quick, and good. Now pick two out of the three" - UnknownReceived on Thu Sep 28 2006 - 18:54:30 CDT
![]() |
![]() |