I'm facing an issue with the date field. I have to load the date column from file to table. I'm reading that filed as string and loading into the date/time filed.
My sample input data from flat file is '20150619 12:43 AM' i have to load this data into any of the date format. Here are the conditions that i have used to load the data:
> IIF(IS_DATE(DATE,'YYYYMMDD HH12:MMPM'),TO_DATE(DATE,'YYYYMMDD HH12:MM:SS'),null)
These conditions didnt workout and loading nulls into the target table. Please suggest me where im doing worng.
Thanks in advance.
In any ETL tool for date we need follow these steps
1) Conver the string to incoming date
2) Now format the converted date to required format
3) Then convert it back to date as per new format
v_B=TO_DATE('20150619 12:43 AM','YYYYMMDD HH12:MM AM')