week day calculation question

  • Thread starter Thread starter dwaynesworld
  • Start date Start date
D

dwaynesworld

Please help!! I cannot get this query to accurately caculate the number of
work days are in a month. I usually have problems with Jan and Feb:

SELECT tblEmployeeData.Name, Sum(Nz([SumOfHours Taken],0)) AS [Hours Taken],
DateDiff("d",([forms]![ParamForm]![StartDate]),([forms]![ParamForm]![EndDate]))+1 AS [Total Days], qryEmployeeTimeOff.StartDate, qryEmployeeTimeOff.EndDate
FROM tblEmployeeData LEFT JOIN qryEmployeeTimeOff ON tblEmployeeData.Name =
qryEmployeeTimeOff.Instructor
WHERE (((tblEmployeeData.Name) Not Like "*Guest*" And (tblEmployeeData.Name)
Not Like "*Self*"))
GROUP BY tblEmployeeData.Name, qryEmployeeTimeOff.StartDate,
qryEmployeeTimeOff.EndDate;

Any assistance is helpful.
 
Here is another query that I use that feeds off of the below query...

SELECT qryEmpTimeOff1.Name, qryEmpTimeOff1.[Hours Taken] AS [SumOfHours
Taken], qryEmpTimeOff1.[Total Days] AS TotalDays, qryEmpTimeOff1.StartDate AS
Expr1, qryEmpTimeOff1.EndDate AS Expr2,
DateDiff("d",[StartDate],[EndDate])-(DateDiff("ww",[StartDate],[EndDate],7)+DateDiff("ww",[StartDate],[EndDate],1)) AS WorkDays
FROM qryEmpTimeOff1;
 
Back
Top