ArizonaRose
Technical User
Hello,
I have scoured the internet trying to find this answer, and I can find part, but not all. I am trying to change a 3 day holiday weekend date to the next business day date.
Example: Memorial Day Weekend- I need all 3 dates (05/29/2004, 05/30/2004 & 05/31/2004) to become the first business day 06/01/2004. Everything I do changes Sat & Sun to 05/31/2004 & Mon to 06/01/2004.
This is the code I've been working with: (the holiday array is in the report header)
Thanks in advance for your help!
Elaine Pope
I have scoured the internet trying to find this answer, and I can find part, but not all. I am trying to change a 3 day holiday weekend date to the next business day date.
Example: Memorial Day Weekend- I need all 3 dates (05/29/2004, 05/30/2004 & 05/31/2004) to become the first business day 06/01/2004. Everything I do changes Sat & Sun to 05/31/2004 & Mon to 06/01/2004.
This is the code I've been working with: (the holiday array is in the report header)
Code:
WhilePrintingRecords;
Local DateVar FirstDay:= {@DateCreated} ;
DateVar StartDate;
DateVar Array Holidays;
If DayOfWeek(FirstDay) = 7 Then //Saturday
StartDate := FirstDay +2
Else
If DayOfWeek(FirstDay) = 1 Then
StartDate := FirstDay + 1 //Sunday
Else
If StartDate = Holidays then //Holiday
StartDate := FirstDay +1
Else
If (DayOfWeek(FirstDay) = 7 and StartDate = Holidays) Then //Saturday & Holiday
StartDate := FirstDay + 2
Else
If (DayOfWeek(FirstDay) = 1 and StartDate = Holidays) Then //Sunday & Holiday
StartDate := FirstDay + 2
Else
StartDate:=FirstDay;
Thanks in advance for your help!
Elaine Pope