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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: [Q] ORACLE date select problem?

Re: [Q] ORACLE date select problem?

From: <MTPConsulting_at_aol.com>
Date: Fri, 13 Oct 2000 11:09:31 EDT
Message-Id: <10648.119191@fatcity.com>


Use:

select account_id, datestamp from table1

    where datestamp < to_date('31-DEC-1996','DD-MON-YYYY');

Otherwise you are doing a character comparision -- that's why you get those results. You have to do a date comparision.

Marc Perkowitz
MTP Systems Consulting

In a message dated 10/13/00 9:44:21 AM Central Daylight Time, leed_at_chele.cais.net writes:

<< On ORACLE 7.3.4 database, I tried to select date less than "31-DEC-96".  the following statement does NOT work correctly:  

    select account_id, datestamp from table1     where to_char(datestamp,'DD-MON-YY') < '31-DEC-96';    

 It still print date like '21_JAN-98'.  

 Anyone can give me a hint? Received on Fri Oct 13 2000 - 10:09:31 CDT

Original text of this message

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