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

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

Re: oracle question to get Date minus 1

From: pawan_test <sridhara007_at_gmail.com>
Date: 28 Sep 2006 20:16:05 -0700
Message-ID: <1159499765.648616.145440@b28g2000cwb.googlegroups.com>


Hi All,

thanks to all of you for your suggestions;

SQL> select to_date('20060928', 'YYYYMMDD') - 1 from dual;

TO_DATE('



27-SEP-06 my desired output in this case is 20060927 but here the output is coming as 27-SEP-06.

can anyone please suggest me how do I get the output as 20060927

thanks a bunch
mark
Mladen Gogala wrote:
> On Thu, 28 Sep 2006 16:50:40 -0700, pawan_test wrote:
>
> > 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
>
> It's very simple:
>
> SQL> select to_char(sysdate+cos(3.14159265359),'MM/DD/YYYY HH24:MM::SS')
> from dual; 2
>
> TO_CHAR(SYSDATE+FLOO
> --------------------
> 09/27/2006 22:09::28
>
>
> --
> http://www.mladen-gogala.com
Received on Thu Sep 28 2006 - 22:16:05 CDT

Original text of this message

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