Help with WHERE in SQL statement

I would like to evalute after AS Store a Where statement that says only include from tblDesignatedEmployee.EmployeeTypeID=1
I continue this pattern at AS District a Where statement that says only include from tblDesignatedEmployee.EmplooyeeTypeID=2
I continue this pattern at AS Support Where statement that says only include from tblDesignatedEmployee.EmployeeTypeID=3
I continue this pattern at AS StoreMgr Where statement that says only include from tblDesignatedEmployee.EmployeeTypeID=4

In other words I want to include only District Managers if the tblDesignatedEmployee.EmployeeTypeID = 1
Include only Support in the tblDesignatedEmployee.EmployeeTypeID=2
Include only StoreMgr in the tblDesignatedEmployee.EmployeeTypeID=3
Include only AsstStorMgr in the tblDesignatedEmployee.EmployeeTypeID=4

SELECT tblStore.StoreNumberID, "Store #" & " " & tblStore.StoreNumber & " " & tblStore.StoreName & " " & tblStates.State AS Store, tblEmployee.EmployeeFirstName & " " & tblEmployee.EmployeeLastName AS District, tblEmployee_1.EmployeeFirstName & " " & tblEmployee_1.EmployeeLastName AS Support, tblEmployee_2.EmployeeFirstName & " " & tblEmployee_2.EmployeeLastName AS StoreMgr, tblEmployee_3.EmployeeFirstName & " " & tblEmployee_3.EmployeeLastName AS AsstStoreMgr
FROM tblStates INNER JOIN (tblStore INNER JOIN (tblEmployee AS tblEmployee_3 INNER JOIN (tblEmployee AS tblEmployee_2 INNER JOIN (tblEmployee AS tblEmployee_1 INNER JOIN (tblEmployee INNER JOIN tblDesignatedEmployee ON tblEmployee.EmployeeID = tblDesignatedEmployee.EmployeeID) ON tblEmployee_1.EmployeeID = tblDesignatedEmployee.EmployeeID) ON tblEmployee_2.EmployeeID = tblDesignatedEmployee.EmployeeID) ON tblEmployee_3.EmployeeID = tblDesignatedEmployee.EmployeeID) ON tblStore.StoreNumberID = tblDesignatedEmployee.StoreID) ON tblStates.StateID = tblStore.StateID
ORDER BY tblStore.StoreNumber;
Frank FreeseAsked:
Who is Participating?
You'll need to create separate queries for each of your WHERE conditions and then join them together on some common ID.
In your query, you add the fields where you want to set your criteria. You dont have to Show them, the uncheck the Show checkbox.

Hope this helps,
Frank FreeseAuthor Commented:
thank you
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.