Date Difference

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
nvuradi
Participant
Posts: 54
Joined: Tue Dec 12, 2006 11:03 pm

Date Difference

Post by nvuradi »

Hi All i have a requirement where in i have to get the difference between two incoming dates as an integer value.

Is there anyway we can get it done. If there is even a part solution, please do post it here. I shall be very thankful.


Thanks
Naru.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

There are lot of ways to get it done. If you make a search you will find a lot of idea.
One simple option is to convert the dates into Julian dates and subtract. The idea is to convert the date into internal or integer format.
JulianDayFromDay() can be used for that.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Kumar is right, if you look at the DS help of these functions, you will see that JulianDayFromDate() will return an integer. You can perform this function on your incoming dates and do the substraction. If you just need the difference and not concerned about which date is higher, you can also use Abs() function on the result to get an absolute value.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply