I have this in part of a select statement that builds a table.
"FROM tblHistory " & _
"INNER JOIN tblActiveJobCd ON tblActiveJobCd.JobCd = tblHistory.JobCd " & _
"WHERE EntryDate >= #" & GoalWeek(x).StartDate & "# " & _
"AND EntryDate <= #" & GoalWeek(x).EndDate & "# " & _
"AND tblHistory.Train = 'N'" & _
"AND tblHistory.CostCd <> '0547'" & _
"GROUP BY tblHistory.JobCd " & _
"ORDER BY tblHistory.JobCd")
In the line: "AND tblHistory.Train = 'N'" & _
I am only selecting Trained Employees. (N denotes not in training)
My problem is that for JobCode 100 and 1500, I want it to select all employees. For all other JobCodes (200 thru 1300) it works fine the way it is.
How do I get both needs into this table?
Do I use another WHERE statement with different criteria statements? Or IF...Then... and where would it go?
"FROM tblHistory " & _
"INNER JOIN tblActiveJobCd ON tblActiveJobCd.JobCd = tblHistory.JobCd " & _
"WHERE EntryDate >= #" & GoalWeek(x).StartDate & "# " & _
"AND EntryDate <= #" & GoalWeek(x).EndDate & "# " & _
"AND tblHistory.Train = 'N'" & _
"AND tblHistory.CostCd <> '0547'" & _
"GROUP BY tblHistory.JobCd " & _
"ORDER BY tblHistory.JobCd")
In the line: "AND tblHistory.Train = 'N'" & _
I am only selecting Trained Employees. (N denotes not in training)
My problem is that for JobCode 100 and 1500, I want it to select all employees. For all other JobCodes (200 thru 1300) it works fine the way it is.
How do I get both needs into this table?
Do I use another WHERE statement with different criteria statements? Or IF...Then... and where would it go?