LPARA ttBegin, ttEnd LOCAL ARRAY laAnswer(1) SELECT cnt(*) FROM HolliDays where BETWEEN( HolliDate, TTOD(ttBegin), TTOD(ttEnd) INTO ARRAY laAnswer ) RETURN laAnswer(1)- Now use the formula ((nWorkingDays-2)*9)+(RestTimeOfFirstDay)+(RestTimeOfLastDay) to calculate the working time in hours.
SELECT ; CalcDays(callopen,callclose) AS WorkingDays, ; ((CalcDays(callopen,callclose)-2)*9)+(RestTimeOfFirstDay)+(RestTimeOfLastDay) AS WorkingTime ; FROM...- BTW: If you want to use this idea within a view place the CalcDays function in the DBCs stored procedures!