简体   繁体   English

在 Informatica 中转换日期格式

[英]Convert Date Format in Informatica

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.我正在尝试将格式 03/08/2021 00:00:00 的 DateTime 属性的源字段转换为 DateTime 属性的目标字段以格式 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')我尝试使用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]. TT_11132 转换 [表达式] 在评估 output 列 [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 ')].错误消息是 [<> [TO_DATE]: invalid string for conversion 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.源和目标的 DataType 都是 DateTime。

Please Try to use the below format:请尝试使用以下格式:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM