Date Calculations

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
rcil
Charter Member
Charter Member
Posts: 70
Joined: Sat Jun 05, 2004 1:37 am

Date Calculations

Post by rcil »

Hello All,

Can I know how to calculate the age by susbstracting two dates. For example (2004-12-01) - (2000-12-01) should give me the result as 4 years and I also want to round of the number if I get any decimals. For example if the result is 5.75 I want to take it as 5 and if the result is less than one year then it should be changed to 0.

thanks,
rcil
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

Hi,
Did you try to convert them into internal format and subrtract the values and convert back .

Try this transform :

DateGenericDateDiff(%FirstInputDate%, %SecondInputDate%)

Let us know if it works.

Thanks,
Post Reply