Trying to convert the date value coming in from csv flat file (2012-04-03 3:43:00 PM) into Normal timestamp value (YYYY-MM-DD HH24:MM:SS - without AM or PM).
DECODE (TRUE,
is_date(Extract_LAIB_LastCCVRefreshDate__c, 'YYYY-MM-DD HH:MM:SS AM'), to_date(Extract_LAIB_LastCCVRefreshDate__c, 'YYYY/MM/DD HH24:MM:SS'),
is_date(Extract_LAIB_LastCCVRefreshDate__c, 'YYYY-MM-DD HH:MM:SS PM'), to_date(Extract_LAIB_LastCCVRefreshDate__c,'YYYY/MM/DD HH24:MM:SS'),
ERROR( 'NOT A VALID DATE') )
Above function gives me invalid expression error, how can I fix this?
Pls use this to convert to date-time first. Then you can convert to anything in char format.
I tested above formula using informatica and here is the output. i used mm/dd/yyyy as output format though.