Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: dates
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 Wed Jun 02 1999 - 23:34:47 CDT
![]() |
![]() |