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: Ruiz, Mary A (CAP, CDI) <Mary.Ruiz_at_gecapital.com>
Date: Fri, 13 Oct 2000 15:32:22 -0400
Message-Id: <10648.119229@fatcity.com>


Please ignore this last post - I read this too quickly. I think you want
where datestamp < to_date('31-DEC-96','DD-MON-RR')   (assuming datestamp is a date datatype)

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

if datestamp is a varchar2, then you would need to convert it using the appropriate format.

Mary Ruiz
Atlanta /GA

-----Original Message-----
From: Ruiz, Mary A (CAP, CDI)
Sent: Friday, October 13, 2000 12:46 PM
To: Multiple recipients of list ORACLE-L Subject: RE: [Q] ORACLE date select problem?

Leed:
  This will find dates between 1950 and 1996:

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

If you have dates prior to 1950, you may need to do more work.

Mary Ruiz / Atlanta GA

-----Original Message-----
Sent: Friday, October 13, 2000 12:07 PM
To: Multiple recipients of list ORACLE-L

I tried this, still same.

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

> Hi L,
>
> The character string '21_JAN-98' IS less than the character string
> '31-DEC-96'.
> If you want a date compare try
>
> where datestamp < to_date('31-DEC-96','DD-MON-YY');
>
> Regards
>
> Garry
>
> -----Original Message-----
> From: L [mailto:leed_at_chele.cais.net]
> Sent: 13 October 2000 15:29
> Subject: [Q] ORACLE date select problem?
>
> 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?
>
>
> Thanks
>
> ++++++++++++++++++++++++++++++++++++
> All internet traffic to this site is
> automatically scanned for viruses
> and vandals.
> ++++++++++++++++++++++++++++++++++++

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

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).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Ruiz, Mary A (CAP, CDI)
  INET: Mary.Ruiz_at_gecapital.com

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
Received on Fri Oct 13 2000 - 14:32:22 CDT

Original text of this message

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