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: Brian Peasland <dba_at_remove_spam.peasland.com>
Date: Wed, 29 Oct 2003 21:23:56 GMT
Message-ID: <3FA02FEC.12A5B0EC@remove_spam.peasland.com>


> SELECT Count(*) FROM EVENTSTREAM WHERE TYPE = 11 AND (TS BETWEEN
> TO_DATE('28-OCT-03') AND TO_DATE('29-OCT-03'));
>
> COUNT(*)
> ----------
> 447

In the above, the date does not include time. So the time is truncated. SYSDATE includes both date *and* time. So it is possible to have different results because you are passing in different values.

When you selected SYSDATE from DUAL, it only showed the time because that is how your NLS_DATE_FORMAT is set. The time is there, but the display just doesn't show it.

HTH,
Brian  

-- 
===================================================================

Brian Peasland
dba_at_remove_spam.peasland.com

Remove the "remove_spam." from the email address to email me.


"I can give it to you cheap, quick, and good. Now pick two out of
 the three"
Received on Wed Oct 29 2003 - 15:23:56 CST

Original text of this message

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