Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: dates

Re: dates

From: Chris Nelson <wrhs71_at_hotmail.com>
Date: Sat, 5 Jun 1999 23:33:08 -0400
Message-ID: <dZl63.699$os.28635@typ42b.nn.bcandid.com>


Not to quibble too much, but Thomas forgot to close parens on the TO_DATE function...

In addition, depending on when (as in 'time of day') you need to make your comparison, you might want to look at :

WHERE TRUNC( initial_date) < TO_DATE( '01-Jan-99', 'dd-Mon-yy')

(etc.) Trunc will look at ONLY the 'day' portion of 'initial_date', so that only rows with 'initial_date' DAYS > 01-Jan-99 will answer. Otherwise you may get unexpected results when you see that you have some dates that appear to be '01-Jan-99', because 'initial_date' may have been stored with a time element you weren't aware of. (For instance, if 'initial_date' is stored as 'sysdate' at record creation, for instance, and not a user-entered day-only date.)

Chris

Thomas Bierhance wrote in message <375587AE.1F33C742_at_orbital-computer.de>...
>> select * from table where initial_date < '01-Jan-99' and final_date >
>> '01-Jan-99';
>>
>
>try the to_date function: to_date ('01-Jan-99', 'dd-mon-yy'
>
>
Received on Sat Jun 05 1999 - 22:33:08 CDT

Original text of this message

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