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!

How to convert the date format to 'YYYY-MM-DD'

francislazaroAug 22 2017 — edited Aug 22 2017

I need to convert the date format to YYYY-MM-DD but when I use this formula TO_DATE(starttime, 'YYYY-MM-DD') in my query, the date in the query output is displayed in this format '17-AUG-16' , '17-AUG-17'.

How do I convert the date to exactly YYYY-MM-DD format ? The output column should be date datatype. And I don't want to use "alter session set nls_date_format" since the query needs to be run via ETL process.

Thanks!

Note: The starttime column in the table contains the data in this format shown below.

pastedImage_0.png

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 19 2017
Added on Aug 22 2017
9 comments
1,925 views