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

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

SUMMARY: [Q] ORACLE date select problem?

From: L <leed_at_chele.cais.net>
Date: Fri, 13 Oct 2000 13:36:34 -0400 (EDT)
Message-Id: <10648.119220@fatcity.com>


Thank you for the answers. I receive so many answer and I tried most of them. Here is SUMMARY.

A lot answers said "this is Y2K problem". It is NOT. It is string comparison problem.

The following answer NOT work under my testing:

  alter session set nls_date_format='dd-mon-yyyy';
  alter session set nls_date_format='dd-mon-RRRR';
  alter session set nls_date_format='dd-mon-RR';
  where datestamp < to_date('31-DEC-96','DD-MON-YY');   where trunc(datestamp) < '31-DEC-96'

The sql work with my testing:

where datestamp < to_Date('31-DEC-1996','dd-mon-yyyy') where to_char(datestamp','YYYYMMDD') < '19961231'

My original posting:

> 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 - 12:36:34 CDT

Original text of this message

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