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

Home -> Community -> Usenet -> c.d.o.misc -> Re: oracle question to get Date minus 1

Re: oracle question to get Date minus 1

From: Brian Peasland <dba_at_nospam.peasland.net>
Date: Thu, 28 Sep 2006 23:54:30 GMT
Message-ID: <J6BuFI.IHx@igsrsparc2.er.usgs.gov>


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" - Unknown
Received on Thu Sep 28 2006 - 18:54:30 CDT

Original text of this message

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