TO_CHAR to convert date getting 'Invalid number' error
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.