The following is my statement:
I need to query for the 4-7 occurrences of codes 21, 22, and/or 23 but only if the field ActionTaken is null at any time within those 4-7 occurrences.
I have tried multiple approaches, but the only results I received were those who had no empty fields in any of the 4-7 occurrences or received no results at all!
I've received a considerable amount of help writing this statement and am grateful. So, I welcome any additional suggestions!!
Thanks in advance!
Rgds,
Kmkland
Code:
SELECT E.[EmpFile#], E!FName & ' ' & E!MName & ' ' & E!LName AS [Employee Name], E.DeptCode, E.Supervisor, Count(*) AS CountOf21_22_23
FROM tblEmpInfo AS E INNER JOIN tblAbsences AS A ON E.[EmpFile#] = A.[EmpFile#]
WHERE (((A.Date_of_Absence)>=Date()-365) AND ((A.Code) In ('21','22','23')))
GROUP BY E.[EmpFile#], E!FName & ' ' & E!MName & ' ' & E!LName, E.DeptCode, E.Supervisor
HAVING (((Count(*)) Between 4 And 7));
I have tried multiple approaches, but the only results I received were those who had no empty fields in any of the 4-7 occurrences or received no results at all!
I've received a considerable amount of help writing this statement and am grateful. So, I welcome any additional suggestions!!
Thanks in advance!
Rgds,
Kmkland