Problem with conversion from date to char
729894Nov 19 2009 — edited Nov 19 2009Hi all!
I wonder why this doesn't work:
SELECT TO_DATE('&&date1', 'DD-Mon-RR'), TO_CHAR('&date1', 'DD-Mon')
FROM DUAL;
UNDEFINE date1;
Furthermore I don't understand why I get "ORA-01722: invalid number". As far as I know this happens when converting TO_NUMBER, which is not the case.
The only way I got this to work is:
SELECT TO_DATE('&&date1', 'DD-Mon-RR'), TO_CHAR(TO_DATE('&date1', 'DD-Mon-RR'), 'DD-Mon')
FROM DUAL;
UNDEFINE date1;
But this way it's more cumbersome.