week day calculation question

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.
 
D

dwaynesworld

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;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

DateDiff calculation 3

Top