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 -> Comparing dates

Comparing dates

From: Sam Jordan <sjo_at_spin.ch>
Date: Mon, 03 May 1999 08:57:40 +0000
Message-ID: <372D6504.53C5CC01@spin.ch>


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

Original text of this message

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