Page 1 of 1

subtract one day from date

Posted: Thu Feb 10, 2011 2:43 pm
by harryhome
Hi need to subtract one day from given date in transformer, dont want to use OCONV , ICONV.


Date - 1 gives complilation error as "Invalid conversion requested from a dfloat to a date."

Posted: Thu Feb 10, 2011 2:49 pm
by Rob4732
Try:

DateFromJulianDay(JulianDayFromDate(CurrentDate()) - 1)

:)

Posted: Thu Feb 10, 2011 3:27 pm
by ray.wurlod

Code: Select all

DateFromDaysSince(InLink.TheDate, -1)

Posted: Sun Feb 13, 2011 8:24 pm
by ds_sai
Is any thing worked for you?

Check the datatype in the DataStage output column...it might be expecting the TimeStamp..and your output column might be in date type.

Posted: Thu Jan 16, 2014 6:03 am
by imfarhan
Thanks Rob4732
I've used your example and its work

Regards
F

Posted: Mon Jul 17, 2017 9:14 pm
by TNZL_BI
Thanks Rob4732 - that worked perfectly :)