I have the following query:
which is supposed to only show EmpFile# 9183 in the results but is showing all EmpFile#'s with Codes 21, 22, and 23.
I can't quite figure out what is wrong with this statement!!!
Any suggestions?????????
Any and all help is greatly appreciated...always!
Rgds,
KMK
Code:
SELECT tblEmpInfo.[EmpFile#], [tblEmpInfo]![FName] & ' ' & [tblEmpInfo]![MName] & ' ' & [tblEmpInfo]![LName] AS EmpName, tblAbsences.Date_of_Absence, tblAbsences.Code, tblReasonsForAbsences.Reasons_for_Absences, tblAbsences.Action_Taken, tblAbsences.Date_of_Action, tblAbsences.Hours_of_Leave
FROM (tblEmpInfo INNER JOIN tblHireDates ON tblEmpInfo.[EmpFile#] = tblHireDates.[EmpFile#]) INNER JOIN (tblAbsences INNER JOIN tblReasonsForAbsences ON tblAbsences.Code = tblReasonsForAbsences.Code) ON tblEmpInfo.[EmpFile#] = tblAbsences.[EmpFile#]
WHERE (((tblEmpInfo.[EmpFile#])="9183") AND ((tblAbsences.Date_of_Absence)>=Date()-365) AND ((tblAbsences.Code)="21") AND ((tblHireDates.Date_of_Separation) Is Null)) OR (((tblAbsences.Code)="22")) OR (((tblAbsences.Code)="23"));
I can't quite figure out what is wrong with this statement!!!
Any suggestions?????????
Any and all help is greatly appreciated...always!
Rgds,
KMK