Domino Code Fragment

Code Name*
Weekday
Date*
02/13/1999
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.219.189.247
Description*
Computes number of weekdays between two dates.
Type*
Formula
Categories*
Date/Time Handling
Implementation:
Modify constants
Required Client:
Server:
Limitations:
Comments:
EndDate and StartDate are fields on the doc
Files/Graphics attachments (if applicable): Code:

diffDays := (EndDate - StartDate) / 86400 + 1;
strtDay := @Modulo(@Weekday(StartDate); 7);
endDay := @Modulo(@Weekday(EndDate); 7);
result := (diffDays - endDay + strtDay - 8) * 5 / 7 - @Max(-2; -strtDay) - @Min(1; endDay) + 5 - strtDay + endDay