//@BusinessDaysIncludingHolidays
//ENTER FIRST DAY
datevar startdate:= DateTimeToDate({TSTrack.DateOfSAL});
//ENTER LAST DAY
datevar enddate:= DateTimeToDate({TSTrack.DateRec});
//ENTER WORKING DAYS
stringvar workingdays:= "-23456-";
//---------------------------------------------------------
//calculate totalworkdays
if DayOfWeek(startdate)=1 or DayOfWeek(startdate)=7 then
numbervar totaldays:= wdaysclass1wdnumworkdays(startdate,enddate,workingdays)-1
else if startdate > enddate then 0
else if startdate = enddate then 0
else if {Staff.stf_salfreqy}="W" and CurrentDate>({TSTrack.DateOfSAL}+7) then
numbervar totaldays:= wdaysclass1wdnumworkdays(startdate,enddate,workingdays)-6
else
numbervar totaldays:= wdaysclass1wdnumworkdays(startdate,enddate,workingdays)-2
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.