CR 8.5, Oracle with ODBC connection
Using the following formula from Ken Hamady's site to calculate 15 business days from the first of the month but am getting an error
The only {CALENDAR_EXCEPTIONS.EXCEPTION_DATE} I have for may is 5/30/2005, which is memorial day.
It worked for the month of April when I ran the report in March but cannot get May's, which should be
SendDt: 5/2/2005
ReturnDt: 5/20/2005
Any ideas?
Thanks,
-LW
Using the following formula from Ken Hamady's site to calculate 15 business days from the first of the month but am getting an error
Code:
Shared datevar SendDt;
shared datevar ReturnDt;
NumberVar Add:= 15; // put the number of days here to add (a positive number)
NumberVar Added := 0;
datevar target := dateserial(year(currentdate),month(currentdate)+1,1);
while dayofweek(target) in [1,7] or target = {CALENDAR_EXCEPTIONS.EXCEPTION_DATE}
do target = target + 1;
SendDt := target;
WHILE Added < Add
Do (target := target +1;
if dayofweek (target) in [2 to 6] and not (target = {CALENDAR_EXCEPTIONS.EXCEPTION_DATE})
then Added:=Added+1
else Added:=Added);
ReturnDt := Target;
The only {CALENDAR_EXCEPTIONS.EXCEPTION_DATE} I have for may is 5/30/2005, which is memorial day.
A loop was evaluated more than the maximum number of allowable times.
It worked for the month of April when I ran the report in March but cannot get May's, which should be
SendDt: 5/2/2005
ReturnDt: 5/20/2005
Any ideas?
Thanks,
-LW