Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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.

AND 
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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading