Question

Bellow code get error with ORA-01820: format code cannot appear in date input format

SELECT to_date('23-04-2014', 'fxdd-mm-iyyy') FROM DUAL

please explain why i can't give date format as ISO year

Was it helpful?

Solution

This message means you have something wrong with your input format:

SQL> SELECT to_date('23-04-2014', 'fxdd-mm-iyyy') dd FROM DUAL;

ORA-01820: format code cannot appear in date input format

SQL> SELECT to_date('23-04-2014', 'fxdd-mm-yyyy') dd FROM DUAL;

DD
-----------
23/04/2014

Have a look at the datetime format elements, the year format iyyy doesn't exist!

OTHER TIPS

In my opinion, TO_DATE doesn't support that, try this:

SELECT to_char(DATE '2014-04-23' , 'fxdd-mm-iyyy') FROM DUAL;

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top