Informatica Expression Convert String to Date
-
21-12-2019 - |
Question
I need to convert a string to a date so I can do a compare with what is in my column. My statement is this:
Decode(IsNew, FALSE,
IIF (v_save_view_row_obsolete_day <>
TO_DATE('9999-12-31 00:00:00 AM','YYYY-MON-DD HH24:MI:SS'),
'9999-12-31 00:00:00', v_save_view_row_obsolete_day))
When I validate I get this error:
Any ideas how to fix this?
Solution
You specified 24-hour format, so you don't need the AM
meridian indicator in the converted date.
Alternatively, you could add AM
to the format parameter of TO_DATE
.
OTHER TIPS
I think that this:
TO_DATE('9999-12-31 00:00:00 AM','YYYY-MON-DD HH24:MI:SS'),
should be this:
TO_DATE('9999-12-31 00:00:00 AM','YYYY-MM-DD HH24:MI:SS'),
MM instead of MON
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow