I have a query which essentially joins names and email addresses out of several tables. The query joins correctly if you do not include the final join and I can't figure out why.
I believe I have the parentheses needed for the joins, but for whatever reason it returns no results. It should return two results on my test. When I delete the final Inner Join and corresponding pieces in the Select statement it returns the two results that I expect, along with the joined fields. Can anyone suggest why I am experiencing this problem?
Code:
SELECT tbl_Session.*, tbl_agent.Agent_Email, tbl_team_mgr.TM_Name, tbl_team_mgr.TM_Email, tbl_NHD.NHD_Name, tbl_NHD.NHD_Email
FROM (((tbl_Session
INNER JOIN tbl_agent ON tbl_Session.SAP_ID = tbl_agent.SAP_ID)
INNER JOIN tbl_team_mgr ON tbl_Session.TM_SAP_ID = tbl_team_mgr.TM_SAP_ID)
INNER JOIN tbl_NHD ON tbl_Session.NHD_SAP_ID = tbl_NHD.NHD_SAP_ID)
WHERE tbl_Session.Status_ID=3;
I believe I have the parentheses needed for the joins, but for whatever reason it returns no results. It should return two results on my test. When I delete the final Inner Join and corresponding pieces in the Select statement it returns the two results that I expect, along with the joined fields. Can anyone suggest why I am experiencing this problem?