G
Guest
I have a query that shows training due by date range for employees with
certain job codes. It works fine for the first job code that I have for
conditions, showing only those that are due between those dates, but for the
job codes listed after that it is showing every training regardless of when
they expire. Any help would be appreciated, I'm sure it's simple, I'm just
overlooking it.
SELECT tblEmployees.LastName, tblEmployees.FirstName, tblTraining.Training,
tblTraining.DateTaken, tblTraining.DateExpires
FROM (tblEmployees INNER JOIN tblTraining ON tblEmployees.EmployeeID =
tblTraining.EmployeeID) INNER JOIN tblWage ON tblEmployees.EmployeeID =
tblWage.EmployeeID
GROUP BY tblEmployees.LastName, tblEmployees.FirstName,
tblTraining.Training, tblTraining.DateTaken, tblTraining.DateExpires
HAVING (((tblTraining.DateExpires) Between [Enter beginning date: example
1/1/04] And [Enter ending date: example 12/31/04]) AND
(((Last(tblWage.Title))="CN/ON")) OR (((Last(tblWage.Title))="Residential
Supervisor")) OR (((Last(tblWage.Title))="Q")) OR
(((Last(tblWage.Title))="Q/Case Coordinator")) OR
(((Last(tblWage.Title))="Team Leader")))
ORDER BY tblEmployees.LastName
WITH OWNERACCESS OPTION;
certain job codes. It works fine for the first job code that I have for
conditions, showing only those that are due between those dates, but for the
job codes listed after that it is showing every training regardless of when
they expire. Any help would be appreciated, I'm sure it's simple, I'm just
overlooking it.
SELECT tblEmployees.LastName, tblEmployees.FirstName, tblTraining.Training,
tblTraining.DateTaken, tblTraining.DateExpires
FROM (tblEmployees INNER JOIN tblTraining ON tblEmployees.EmployeeID =
tblTraining.EmployeeID) INNER JOIN tblWage ON tblEmployees.EmployeeID =
tblWage.EmployeeID
GROUP BY tblEmployees.LastName, tblEmployees.FirstName,
tblTraining.Training, tblTraining.DateTaken, tblTraining.DateExpires
HAVING (((tblTraining.DateExpires) Between [Enter beginning date: example
1/1/04] And [Enter ending date: example 12/31/04]) AND
(((Last(tblWage.Title))="CN/ON")) OR (((Last(tblWage.Title))="Residential
Supervisor")) OR (((Last(tblWage.Title))="Q")) OR
(((Last(tblWage.Title))="Q/Case Coordinator")) OR
(((Last(tblWage.Title))="Team Leader")))
ORDER BY tblEmployees.LastName
WITH OWNERACCESS OPTION;