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: Difference between SYSDATE and TO_DATE

Re: Difference between SYSDATE and TO_DATE

From: Al Reid <areidjr_at_reidhyphenhome.com>
Date: Thu, 30 Oct 2003 08:46:25 -0500
Message-ID: <vq25a2eb7ib8f@corp.supernews.com>


I believe you could use TRUNC(SYSDATE) as well to eliminate the time portion for date only comparisons.

--
Al Reid

"It ain't what you don't know that gets you into trouble. It's what you know
for sure that just ain't so."  --- Mark Twain

"Tom" <tomNOSPAM_at_teameazyriders.com> wrote in message news:1067520374.3388.0_at_despina.uk.clara.net...

>
> > Tom,
> >
> >
> >
> > You need to be careful when working with date and remember that the date
> > functions are available so use them when needed. Also when using the
> > date range, allways go from older-date to newer-date not the other way
> > around like you had, so try this instead:
> >
> >
> >
> > SELECT Count(*)
> >
> > FROM EVENTSTREAM
> >
> > WHERE TYPE = 11
> >
> > AND (TS BETWEEN to_char(sysdate -1, 'DD-MON-YY') AND
> >
> > to_char(sysdate, 'DD-MON-YY'));
>
> Thanks all -
>
> seems i should avoid using sysdate then and focus on to_date.
>
> thanks
>
> Tom
>
>
Received on Thu Oct 30 2003 - 07:46:25 CST

Original text of this message

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