Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Question on the date after '31-DEC-9999' in Oracle
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
![]() |
![]() |