I have a query running on an absence db here to show all users with more than 5 absences in a given time period. A very basic query is all that is required, and it seemed to be working fine until we noticed that one particular individual, who we know to have 11 absences in the time period entered, was not on the report. Below is the SQL for the query. Can anyone shed any light as to why it is not picking up this one individual?
SELECT tName.Name, Count(tStaff.Name) AS CountOfName
FROM tName INNER JOIN ((tDept INNER JOIN tAbsence ON tDept.DeptID = tAbsence.Dept) INNER JOIN tStaff ON tDept.DeptID = tStaff.Department) ON (tName.NameID = tAbsence.Name) AND (tName.NameID = tStaff.Name)
WHERE (((tAbsence.[First Day])>=[Start Date:]) AND ((tAbsence.[Last Day])<[End Date:]))
GROUP BY tName.Name
HAVING (((Count(tStaff.Name))>4));
The man in black fled across the desert, and the Gunslinger followed
SELECT tName.Name, Count(tStaff.Name) AS CountOfName
FROM tName INNER JOIN ((tDept INNER JOIN tAbsence ON tDept.DeptID = tAbsence.Dept) INNER JOIN tStaff ON tDept.DeptID = tStaff.Department) ON (tName.NameID = tAbsence.Name) AND (tName.NameID = tStaff.Name)
WHERE (((tAbsence.[First Day])>=[Start Date:]) AND ((tAbsence.[Last Day])<[End Date:]))
GROUP BY tName.Name
HAVING (((Count(tStaff.Name))>4));
The man in black fled across the desert, and the Gunslinger followed