Hi,
My dates are coming as varchar format as 20100503 i want to "%yyyy%mm%dd" and do -1 day too somehow -1 day is not working in syntax below please advise.
Thanks
IF IsValid("date", DSLink19.HRP1001_BEGDA -1, "%yyyy%mm%dd")
THEN StringToDate(DSLink19.HRP1001_BEGDA -1 ,"%yyyy%mm%dd")
ELSE StringToDate("00000101","%yyyy%mm%dd")
date - 1 day transformationm
Moderators: chulett, rschirm, roy
That is not the proper way to modify a date. Your source will be converted to a simple integer, then the math performed, then the outer functions performed. While probably most dates might work, several would not--for example, 20100501 - 1 = 20100500, which would not be a valid date.
Take a browse through the date and time functions available for parallel transformers. They are documented in the information center and the production documentation for the version of DataStage you are using. A few possibilities are DateFromDaysSince, DateOffsetByComponents and DateOffsetByDays
IS 9.1: Date and Time Functions
IS 8.7: Date and Time Functions
Regards,
Take a browse through the date and time functions available for parallel transformers. They are documented in the information center and the production documentation for the version of DataStage you are using. A few possibilities are DateFromDaysSince, DateOffsetByComponents and DateOffsetByDays
IS 9.1: Date and Time Functions
IS 8.7: Date and Time Functions
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.