gscheepers
IS-IT--Management
Hi everyone,
I'm trying to work out the number of work days between two dates.
I've been trying to use this formula, but it's not giving me the exact result I'm looking for:
datevar firstday;datevar lastday;numbervar loop;numbervar wds; numbervar span;
firstday:=date({ABSENCE.First_day});
lastday:=date({ABSENCE.Last_day});
span:=lastday-firstday;
For loop:= 0 to span do(
if dayofweek(firstday+loop)in [2 to 7] then wds:=wds+1 else wds:=wds);
//holidays
if Date(2002,01,01) in firstday to lastday then wds:= wds-1 ;
wds
The two dates appears in the details section.
Your help would be greatly appreciated! Gerhard Scheepers
"Great souls have wills; feeble ones only wishes..."
I'm trying to work out the number of work days between two dates.
I've been trying to use this formula, but it's not giving me the exact result I'm looking for:
datevar firstday;datevar lastday;numbervar loop;numbervar wds; numbervar span;
firstday:=date({ABSENCE.First_day});
lastday:=date({ABSENCE.Last_day});
span:=lastday-firstday;
For loop:= 0 to span do(
if dayofweek(firstday+loop)in [2 to 7] then wds:=wds+1 else wds:=wds);
//holidays
if Date(2002,01,01) in firstday to lastday then wds:= wds-1 ;
wds
The two dates appears in the details section.
Your help would be greatly appreciated! Gerhard Scheepers
"Great souls have wills; feeble ones only wishes..."