1
votes

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?

5
it works fine for me, please check your source data again. Also, are you sure it should be MI:SS instead of HH:MI? Anyway, Informatica would interpret the hour as 00. - Samik
It works with me , howevere you can check with TO_DATE(col, 'DD/MM/YYYY HH:MI:SS') otherwise the another solution is to_date(susbtsr(col,1,10),''DD/MM/YYYY') - anwaar_hell

5 Answers

1
votes

You need to use MI:

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

1
votes

Try following (I believe MOHAMMED may be implying same but without actual code snippet it isnt clear)

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

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)...

1
votes

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

1
votes

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.