简体   繁体   中英

Is different date format comparison works in Informatica?

Suppose my source data is coming in the format of 'YYYY-MM-DD HH:MM:SS' and i want to compare with a date format of 'MM/DD/YYYY' will it work or do i need to change the format of and make both the field in same format.

You have to convert to respective format and then compare

If your date column from the source is string, you have to convert it to date format and then to respective format, using below function,

Port1(Variable port) -  Date_V : TO_DATE(date_column, 'YYYY-MM-DD HH24:MI:SS')
Port2(Output port) -  Date_O : TO_DATE(TO_CHAR(Date_V, 'YYYY-MM-DD HH24:MI:SS'), 'MM/DD/YYYY')

If your date format from the source is already in date format, you just have convert to the respective format,

   TO_DATE(TO_CHAR(NEWFIELD1, 'YYYY-MM-DD HH24:MI:SS'), 'MM/DD/YYYY')

Well... There's no such thing as different date format;)

What you're actually talking here about, is strings. Once you convert your strings to date , you're free to compare them. A date is a kind of a number, in fact.

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