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!

TO_CHAR to convert date getting 'Invalid number' error

dprogrammerxJun 24 2010 — edited Jun 24 2010
I am trying to convert a static date value using TO_CHAR function but I can't believe I am not able to do it such a simple conversion.

//Obviously this is easy and everyone would like to give this as an example and this is what I see everwhere on Google and it works.

SELECT TO_CHAR(sysdate, 'YYYY-MM-DD') FROM DUAL;

How can I make it work like this?

SELECT TO_CHAR('2010-JUN-23', 'YYYY-MM-DD') FROM DUAL;

I keep getting "Invalid number" error. I changed my constant date to different formats but none works.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 22 2010
Added on Jun 24 2010
8 comments
26,050 views