First of all I’d like to thank those who have helped me through the last week of questions regarding access. I greatly appreciate it. Here is one of my last hurtles for this project.
The following query works great. 1 employee will have many assignments, 1 assignment to 1 record on tbl12. Now I’d like to also add in to this a table of comments. 1 record on table 142 may have many comments. I cannnot for the life of me add in the comments table so that it does not remove records from the query if a record does not have any comments. I get errors trying to switch it to a left / right join.
SELECT tbl142Assignments.*, tbl142.*, tblEmployees.*, tblEmployees.ID
FROM tbl142 INNER JOIN (tbl142Assignments INNER JOIN tblEmployees ON tbl142Assignments.assignedTo = tblEmployees.ID) ON tbl142.ID = tbl142Assignments.ID
WHERE (((tblEmployees.ID)=Environ()));
Join Expression not supported is usually what I get. I’ve tried all kinds of different setups but am having trouble since access doesnt allow outter joins. In any case, I realize I have inner joins set up now but all should be left / right joins.
SELECT tbl142Assignments.*, tbl142.*, tblEmployees.*, tblEmployees.ID
FROM tbl142 LEFT JOIN (tbl142Assignments LEFT JOIN tblEmployees ON tbl142Assignments.assignedTo = tblEmployees.ID) ON tbl142.ID = tbl142Assignments.ID
WHERE (((tblEmployees.ID)=Environ()));
That works the way I want it to also but everything I have so far is 1 to 1 relationship really… While the comments will have 0 to many