I have time stamp values such as 30/05/06 11:40:34.000000000 AM
in the column. I need to extract Year (i.e. 2006) and the month (i.e. 05) from this value. Below is my SQL.
SELECT EXTRACT(YEAR FROM TO_DATE('19/10/09 10:45:44.000000000 AM')) FROM DUAL;
After running above SQL, I get an error APPROVED_PROPOSALS
.
So, I tried to provide the format as below,
SELECT EXTRACT(YEAR FROM TO_DATE('19/10/09 10:45:44.000000000 AM','HH12:MI:SS.FF')) FROM DUAL;
However, still getting some errors. I am pretty sure that, the format I am providing is not correct.
ORA-01821: date format not recognized
Please help me, to get Year and Month form such values.
Kiran.