Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

converting from date to char returns 9999 as year

Ora-affSep 12 2014 — edited Sep 12 2014

Hi,

My SQL Developer version is

Oracle IDE3.2.20.09.87

I have a table T which has a column col of type Date

I fire:

select col from T;

I get the returned value as : 31-DEC-99

When I fire:

select to_char(col,'YYYY/DD/MM') from T;

I get the returned value as: 9999/31/12

However, when I fire:

select to_char(to_date('31-DEC-99','DD-MON-YY'),'YYYY/DD/MM') from dual;

I get the returned value as: 2099/31/12

What could be the reason of two different returned values when selecting from DUAL and T?

This post has been answered by Marwim on Sep 12 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 10 2014
Added on Sep 12 2014
5 comments
5,380 views