Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Comparing dates
My guess would be that EVENTDATE is actually 01-MAY-0099 ...
try :
select to_char(eventdate,'dd-mon-yyyy') from history ;
to expand it including century.
You might have some Y2K bugs to fix ...
cheers
Glenn Baron
Sam Jordan <sjo_at_spin.ch> wrote in article <372D6504.53C5CC01_at_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 - 06:15:52 CDT
![]() |
![]() |