Re: dates

From: Sherry Kainz <skainz_at_usa.net>
Date: Wed, 02 Jun 1999 22:34:47 -0600
Message-ID: <375605E6.AE48F92F_at_usa.net>


You didn't say what in particular didn't work...did you not get expected results or did you return a syntax error of some kind? Oracle dates are actually a stored representation of datetime, so equality matches often fail because '01-JAN-99' does not equal '01-JAN-99 07:00:00' for example. However <,>, or between usually work. Assuming sql/plus,

   select * from mytab
   where initial_date < '01-JAN-99'

      and final_date > '01-JAN-99';
should work syntactically (may return no rows however :-) )

Greg

Silicon Knight wrote:

> I am trying to do a select on tables based on dates and I can't get it to
> work.
>
> ex.
>
> select * from table where initial_date < '01-Jan-99' and final_date >
> '01-Jan-99';
>
> any idea why this doesn't work?
>
> Thanks in advance,
>
> Tim
Received on Thu Jun 03 1999 - 06:34:47 CEST

Original text of this message