Add a number of days to a Date in PX job

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
Hongqing
Participant
Posts: 9
Joined: Fri Aug 20, 2004 5:53 pm
Location: Pleasanton, CA

Add a number of days to a Date in PX job

Post by Hongqing »

In a PX job, I am trying to add a number (days) to a date and come up with a new date. For example, I want to add 185 day to date 2003-05-24 and come up with a new date. Can any one help? :idea:

Thanks in advance.
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Re: Add a number of days to a Date in PX job

Post by lstsaur »

[quote="Hongqing"]In a PX job, I am trying to add a number (days) to a date and come up with a new date. For example, I want to add 185 day to date 2003-05-24 and come up with a new date. Can any one help? :idea:

Thanks in advance.[/quote]

You first convert 2003-05-24 to a Julian day; then add 185 day to the Julian day; last convert the result back to the date format that you want.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Details, man, details! :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

Code: Select all

DateFromJulianDay(JulianDayFromDate(input.field) + 185))
nuff details?
Post Reply