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

Home -> Community -> Usenet -> c.d.o.server -> Re: Easy date problem

Re: Easy date problem

From: Andreas Stephan <nospam.as.stedat_at_gmx.net>
Date: 2000/05/29
Message-ID: <393278E3.8A681D05@gmx.net>#1/1

Seems as if you are running in a Y2K problem ;-) The output of oracle means 05-OCT-1995 but only the last two digits are displayed (historical reasons).
Your where clause evaluates to ... edate > '01-JAN-2096' So no question why there are no rows returned ;-)

Try ...where edate > to_date('01-JAN-1996','DD-MON-YYYY');

hth
Andy

balanagu_at_my-deja.com schrieb:

> Hello everybody,
> I cannot query by date. I am having some kind of problem with dates.
> Here are the outputs.
>
> I am **** ing the soc_sec_nbr for privacy. But I am using the same
> soc_sec_nbr on both statement.
>
> select edate from narrative where soc_sec_nbr = '************';
> EDATE
> --------------------
> 05-OCT-95
> 18-OCT-95
> 01-DEC-95
> 04-DEC-95
> 04-DEC-95
> 07-DEC-95
> 07-DEC-95
> 07-DEC-95
> 07-DEC-95
> 08-DEC-95
> 12-DEC-95
> 13-DEC-95
> 15-DEC-95
> 15-DEC-95
> 22-DEC-95
> 22-DEC-95
> 27-DEC-95
> 27-DEC-95
> 28-DEC-95
> 29-DEC-95
> 02-JAN-96
> 05-JAN-96
> 11-JAN-96
> 11-JAN-96
> 12-JAN-96
> 18-JAN-96
> 18-JAN-96
> 23-JAN-96
> 24-JAN-96
> 24-JAN-96
> 25-JAN-96
> 26-JAN-96
> 29-JAN-96
> 29-JAN-96
> 01-FEB-96
> 20-FEB-96
> 29-FEB-96
> 01-MAR-96
> 19-MAR-96
> 19-MAR-96
> 28-MAR-96
> 19-APR-96
> 01-MAY-96
> 08-MAY-96
> 14-JUN-96
> 26-JUN-96
> 25-JUL-96
> 30-JUL-96
> 06-AUG-96
> 13-AUG-96
> 15-AUG-96
> 30-AUG-96
> 10-SEP-96
> 16-SEP-96
> 22-DEC-96
> 55 rows selected.
>
> SQLWKS> select edate from narrative where soc_sec_nbr = '***********'
> and edate > to_date('01-JAN-96');
> EDATE
> --------------------
> 0 rows selected.
>
> I wonder why? What am I doing wrong?
> Thanks in advance.
> Bala
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Mon May 29 2000 - 00:00:00 CDT

Original text of this message

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