TO_DATE format SQL

I’m beginner. I have a problem that I can’t solved. I would like to add the arguments for DATE. But I have an exception: ORA-01830: date format picture ends before converting entire input string.
My code is below.

TO_DATE(so.org_due_date,'DD-MM-YYYY') >= ('01-11-2021')

Can somebody give tips how can I add this arguments? Thanks every1 for help.
I appreciate that.

>Solution :

Assuming that the org_due_date column be text, containing text dates in the format DD-MM-YYYY, the comparison should be:

TO_DATE(so.org_due_date, 'DD-MM-YYYY') >= date '2021-11-01';

While the input to the TO_DATE() function is text in the format DD-MM-YYYY, one valid Oracle date literal takes the format given above.

Leave a Reply