subtract one day from date

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
harryhome
Participant
Posts: 112
Joined: Wed Oct 18, 2006 7:10 am

subtract one day from date

Post 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."
Rob4732
Premium Member
Premium Member
Posts: 66
Joined: Mon Oct 06, 2008 5:14 pm

Post by Rob4732 »

Try:

DateFromJulianDay(JulianDayFromDate(CurrentDate()) - 1)

:)
We don't see things as they are;
We see them as we are.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code: Select all

DateFromDaysSince(InLink.TheDate, -1)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ds_sai
Participant
Posts: 27
Joined: Wed Oct 31, 2007 12:22 pm

Post 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.
imfarhan
Participant
Posts: 53
Joined: Tue Jul 24, 2012 9:34 am

Post by imfarhan »

Thanks Rob4732
I've used your example and its work

Regards
F
Farhan Syed
TNZL_BI
Premium Member
Premium Member
Posts: 24
Joined: Mon Aug 20, 2012 5:15 am
Location: NZ

Post by TNZL_BI »

Thanks Rob4732 - that worked perfectly :)
Post Reply