rolling forward of date
Posted: Tue Oct 26, 2004 8:37 am
Hi,
I need to roll forward Date1 till it crosses Date2 based on a frequencies (Monthly, Bi yearly, Quarterly etc.)
eg
Date1 = 01/01/1997
Date2 = 09/30/2004
Frequency = Monthly
Forwarded Date = 10/01/2004
Date1 = 01/01/1997
Date2 = 09/30/2004
Frequency = Quarterly
Forwarded Date = 12/01/2004
and so on
I have a routine which would add the appropriate frequency <b>ONCE</b> to Date1 and return the Forwarded Date. When I try using it in a loop (till forwarded date >= Date2) the performance of the job goes down from 300 rows per sec to <1 row per sec.
Testing the routine for a set of values from the source seems to work fine and fast.
1. Have anybody faced a performance issue when a routine that loops is used?
2. Do you think there would be other ways I can implement the rule?
Thanks
Sonia
I need to roll forward Date1 till it crosses Date2 based on a frequencies (Monthly, Bi yearly, Quarterly etc.)
eg
Date1 = 01/01/1997
Date2 = 09/30/2004
Frequency = Monthly
Forwarded Date = 10/01/2004
Date1 = 01/01/1997
Date2 = 09/30/2004
Frequency = Quarterly
Forwarded Date = 12/01/2004
and so on
I have a routine which would add the appropriate frequency <b>ONCE</b> to Date1 and return the Forwarded Date. When I try using it in a loop (till forwarded date >= Date2) the performance of the job goes down from 300 rows per sec to <1 row per sec.
Testing the routine for a set of values from the source seems to work fine and fast.
1. Have anybody faced a performance issue when a routine that loops is used?
2. Do you think there would be other ways I can implement the rule?
Thanks
Sonia