Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Difference between SYSDATE and TO_DATE
> 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