I am attempting to select a date column that includes multiple date formats, including yyyymmdd and yyyy.
When running the query below, the following error occurs: ORA-01840: input value not long enough for date format
ALTER SESSION SET NLS_DATE_FORMAT = 'yyyy-mm-dd';
select to_date(date_table.date,'yyyy-mm-dd'))
from head_table
inner join date_table
on date_table.recordID = head_table.recordID
Can someone please provide assistance on how to select a data based column that contains two formats.
My expected output for 4 different records would be:
2017-12-12
2014
2011-04-15
2015
Thank you!