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: Jay Hostetter <jhostetter_at_decommunications.com>
Date: Fri, 13 Oct 2000 14:15:05 -0400
Message-Id: <10648.119225@fatcity.com>


Free yourself from the NLS_DATE_FORMAT by being specific. Try:

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

(note the 4 digit year)

Jay Hostetter
Oracle DBA
D. & E. Communications
Ephrata, PA USA

>>> L <leed_at_chele.cais.net> 10/13/00 12:06PM >>> I tried this, still same.

On Fri, 13 Oct 2000, Gillies, Garry wrote:

> Hi L,

>=20

> The character string '21_JAN-98' IS less than the character string
> '31-DEC-96'.
> If you want a date compare try
>=20

> where datestamp < to_date('31-DEC-96','DD-MON-YY');
>=20

> Regards
>=20

> Garry
>=20

> -----Original Message-----
> From: L [mailto:leed_at_chele.cais.net]=20
> Sent: 13 October 2000 15:29
> Subject: [Q] ORACLE date select problem?
>=20

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

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

> It still print date like '21_JAN-98'. =20
>=20

> Anyone can give me a hint?
>=20
>=20

> Thanks
>=20

> ++++++++++++++++++++++++++++++++++++
> All internet traffic to this site is=20
> automatically scanned for viruses=20
> and vandals.
> ++++++++++++++++++++++++++++++++++++

--=20
Please see the official ORACLE-L FAQ: http://www.orafaq.com=20 --=20
Author: L
  INET: leed_at_chele.cais.net=20

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Fri Oct 13 2000 - 13:15:05 CDT

Original text of this message

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