Difference between dates

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You did not specify what units of measurement the number should be.
Most databases have a DATEDIFF function available (perhaps with a different name).
If you want to do this in DataStage, convert the two dates into internal format (which is the number of days since 31 Dec 1967) and subtract, which gives a result in days. For example:
Iconv(HireDate,"DDMY")-Iconv(JoinDate,"DDMY")

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
Post Reply