I am trying to create a formula to count the number of weekdays(Mon-Fri) in a date range. My effort so far is:
Local NumberVar Weekdays :=0;
Local NumberVar index ;
for index := {DBTable.Date1} to {DBTable.Date2} do
(
if(DayOfWeek(index)in 2 to 6 )then
Weekdays := Weekdays + 1
);
Weekdays
This doesn't work as a FOR loop requires an interger and not a date field to count.
Has anybody any better ideas? Thanks.
Local NumberVar Weekdays :=0;
Local NumberVar index ;
for index := {DBTable.Date1} to {DBTable.Date2} do
(
if(DayOfWeek(index)in 2 to 6 )then
Weekdays := Weekdays + 1
);
Weekdays
This doesn't work as a FOR loop requires an interger and not a date field to count.
Has anybody any better ideas? Thanks.