Dear All,
In my project I am Subtracting 2 dates.I have ValueDate and MaturityDate So I m doing MaturityDate - ValueDate So that i will get difference in Days.My Business Requirement needs the difference in Months So what i did approxiately (MDATE - VDATE) / 30 So i m getting Difference in Months.But if u concern the output value it will be a Real/Decimal Value.
Example
ValueDate ---> 27/Feb/2003
MaturityDate ---> 27/Mar/2003
So (MDate - Vdate) ---> 28 Days (Diff in Days)
(MDate - Vdate)/30 ---> 0.93 (Diff in Months)...
I am getting the desired result as 0.93.
But the Need is,it need to be rouded off to the nearest interger.
Example
If the Range is like 0.5 To 0.99 it should rounded to 1.
In my case I need the output as '1' rather than 0.93 coz nearst integer is '1'
So I need the Function which will similar to Round() or CEIL() which is there in VB or Excel Tools.
I tried using INT() Function in DataStage it is simply truncating the decimal and returning me '0' for '0.9'.
Please can anybody help me...
Thanks & Regards,
K.S.Rajan.
Rounding off to Nearst Integer Please Help Me...
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 39
- Joined: Tue May 20, 2003 3:36 am
- Location: Singapore