简体   繁体   中英

Date Format in Informatica

I am trying to convert a string to date in Informatica as follows

 TO_DATE('10/21/2014 0:00', 'MM/DD/YYYY MI:SS')

but it throws an error for incorrect string. Can Informatica process this date format: MM/DD/YYYY MI:SS ? If not, is there any solution to process this date format in Informatica?

You need to use MI:

TO_DATE(FIELD, 'YYYY/MM/DD HH:MI:SS')

What I am thinking is TO_DATE('10/21/2014 0:00', 'MM/DD/YYYY MI:SS') . The timestamp part in the given string is invalid. It should be HH:MI(00:00)...

尝试遵循(我相信 MOHAMMED 可能暗示相同,但​​没有实际代码片段尚不清楚)

TO_DATE('10/21/2014 00:00', 'MM/DD/YYYY MI:SS')

Try to use the following snippet :

TO_DATE( 'Your_Date', 'MM/DD/YY HH24:MI:SS' )

You can check for more examples on the below link : to_date_function

There is also a difference between two digit times and single digit times. I usually detect the input and then either reject it using Error() if it doesn't fit the format or add the appropriate leading digits depending on the rules to be applied.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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