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: Question on the date after '31-DEC-9999' in Oracle

Re: Question on the date after '31-DEC-9999' in Oracle

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 24 May 2005 07:06:18 -0700
Message-ID: <1116943578.296849.255860@g49g2000cwa.googlegroups.com>

Mike wrote:
> When I give the following
> SQL> select to_char(enddate,'DD-MON-YYYY') from pc_mike where enddate
>
>
> '31-DEC-9999';
>
> TO_CHAR(END
> -----------
> 00-000-0000
> 00-000-0000
> 00-000-0000
> 00-000-0000
> 00-000-0000
> 00-000-0000
> 00-000-0000
> 00-000-0000
> 00-000-0000
> 00-000-0000
> 00-000-0000
>
> This was the result........any suggestions.

You forgot to use to_date in the where clause. '31-DEC-9999' is just a string... use to_date around it to convert it to date. Try this,

select enddate
from pc_mike
where trunc(enddate) > trunc(to_date('31-DEC-9999','DD-MON-YYYY'));

Regards
/Rauf Received on Tue May 24 2005 - 09:06:18 CDT

Original text of this message

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