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!

Extract year

deahayesDec 16 2022

Hello all,

I am trying to extract the year from a variable but I am getting an error ORA-01861: literal does not match format string

How to rewrite this?
SELECT EXTRACT(YEAR FROM TO_DATE('2023/01/04 00:00:00', 'DD-MON-RR')) INTO RATE_YEAR FROM DUAL;

This post has been answered by Jason_(A_Non) on Dec 16 2022
Jump to Answer
Comments
Post Details
Added on Dec 16 2022
5 comments
379 views