Can anyone help on the following case. Thanks a lot!!!
I have a date field and want to calculate the date after 24 month, does any function exist in Transformer or any other else ?
Calculation on DATE
Moderators: chulett, rschirm, roy
Re: Calculation on DATE
Hi,benny.lbs wrote:Can anyone help on the following case. Thanks a lot!!!
I have a date field and want to calculate the date after 24 month, does any function exist in Transformer or any other else ?
There is a custom routine called "AddMonthsToCurrentMonth(%Arg1%, %Arg2%)".Here u need to extract month part from ur date field and use it as Arg1 and in Arg2 use 24.
Re: Calculation on DATE
rumu, thanks for your reply, but where can I find/call this routine ?
rumu wrote:Hi,benny.lbs wrote:Can anyone help on the following case. Thanks a lot!!!
I have a date field and want to calculate the date after 24 month, does any function exist in Transformer or any other else ?
There is a custom routine called "AddMonthsToCurrentMonth(%Arg1%, %Arg2%)".Here u need to extract month part from ur date field and use it as Arg1 and in Arg2 use 24.
Re: Calculation on DATE
You will find it under Ruotine/custum folder.Try it using Manager.benny.lbs wrote:rumu, thanks for your reply, but where can I find/call this routine ?
rumu wrote:Hi,benny.lbs wrote:Can anyone help on the following case. Thanks a lot!!!
I have a date field and want to calculate the date after 24 month, does any function exist in Transformer or any other else ?
There is a custom routine called "AddMonthsToCurrentMonth(%Arg1%, %Arg2%)".Here u need to extract month part from ur date field and use it as Arg1 and in Arg2 use 24.
Re: Calculation on DATE
The path does NOT exist :<
rumu wrote:You will find it under Ruotine/custum folder.Try it using Manager.
-
- Participant
- Posts: 232
- Joined: Sat May 07, 2005 2:49 pm
- Location: USA
Hi Benny,
I think that rumu meant Routines/Custom, further the routine AddMonthsToCurrentMonth seems like a custom routine which they developed themselves. Therfore you will not find it.
Your best bet would be to implement your own logic using the combination of Iconv and Oconv functions.
I think that rumu meant Routines/Custom, further the routine AddMonthsToCurrentMonth seems like a custom routine which they developed themselves. Therfore you will not find it.
Your best bet would be to implement your own logic using the combination of Iconv and Oconv functions.
Thanks,
Naveen
Naveen
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What about leap years?
For 24 months wouldn't it be easier to add 2 to the year component, then roll back one day if the result is 29 Feb?
This algorithm fails for the year 2BC but otherwise is OK. You could build in a check for this if you are likely to process dates in that range.
For 24 months wouldn't it be easier to add 2 to the year component, then roll back one day if the result is 29 Feb?
This algorithm fails for the year 2BC but otherwise is OK. You could build in a check for this if you are likely to process dates in that range.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.