Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Comparing dates
Hi
Can anyone explain this:
SQL> select * from history where key = 21120;
KEY EVENT USR PRODUCT EVENTDATE ENTRYDATE
---------- ---------- ---------- ---------- --------- ---------
21120 4852 11351 4844 01-MAY-99 03-MAY-99 SQL> select count(*) from history where trunc(eventdate) = trunc(to_date('01-05-1999','DD-MM-YYYY'));
COUNT(*)
0
I thought that trunc() without fmt argument returns the current day with time set to midnight? Why then does the above comparison not find the row first printed out? How should this comparison be done? What's the usual way of finding out if one date's day is equal to the other date's day?
bye
--
Sam Jordan
Received on Mon May 03 1999 - 03:57:40 CDT
![]() |
![]() |