0
votes

I am trying to convert source field of DateTime attribute of format 03/08/2021 00:00:00 to target field of DateTime attribute to format 2021-03-08 00:00:00.

I tried using TO_DATE(TO_CHAR(DATE_CON,'YYYY-MM-DD HH24:MI:SS'),'YYYY-MM-DD HH24:MI:SS')

but got following error:

TT_11132 Transformation [Expression] had an error evaluating output column [DATE_CON]. Error message is [<> [TO_DATE]: invalid string for converting to Date ... t:TO_DATE(u:TO_CHAR(t:<03/08/2021 00:00:00>,u:'YYYY-MM-DD HH24:MI;SS'),u:'YYYY-MM-DD HH24:MI:SS ')].

How can I resolve this error? DataType of both source and target is DateTime.

1
Are the source and target Oracle databases (given the tags)? If so, Oracle doesn't have a datetime data type. It has date. And it has timestamp. Neither of which have a human-readable format. They're always stored in a packed binary format that is independent of the way the application may convert the date or timestamp to a human-readable string.Justin Cave
You have semicolon in you rinformatica expression. I am sure this is missed. Pls fix it and it will be all good. This is from your error msg, pls note there is a semicolon between MI and SS. 'YYYY-MM-DD HH24:MI;SS'),u:'YYY.Koushik Roy

1 Answers

0
votes

Please Try to use the below format :

TO_date (TO_CHAR(DATE_CON),'YYYYMMDDHH24:MI:SS')