Forum Discussion
sarahjane2046
Jul 01, 2022Copper Contributor
Missing data when joining tables in a query?
I'm brand new to Access, so not sure if I'm even asking the right question. I have one Table, tblStudents, that has many rows of students with columns such as student ID, student name, student me...
- Jul 01, 2022
First a bit of fiddly terminology accuracy.
"Cells" are in Excel and Word. In Access, you have "Fields" in tables, not cells.You have an INNER JOIN, which as you realize only returns records which match on MentorID.
If you want to return ALL records from one table, and only MATCHING records from the other table, you need to use an OUTER JOIN.
sarahjane2046
Jul 01, 2022Copper Contributor
I've changed my SQL to
FROM tblStudents LEFT JOIN tblStudents ON tblStudents.MentorID=tblMentors.MentorID;
However, it says that there is a syntax error in the JOIN statement? I feel like I'm missing something obvious
FROM tblStudents LEFT JOIN tblStudents ON tblStudents.MentorID=tblMentors.MentorID;
However, it says that there is a syntax error in the JOIN statement? I feel like I'm missing something obvious
sarahjane2046
Jul 01, 2022Copper Contributor
FROM tblStudents LEFT OUTER JOIN tblStudents ON tblStudents.MentorID=tblMentors.MentorID;
Also causes a syntax error
Also causes a syntax error
- sarahjane2046Jul 01, 2022Copper ContributorNevermind, I'm dumb
FROM tblStudents LEFT OUTER JOIN tblMentors ON tblStudents.MentorID=tblMentors.MentorID;- George_HepworthJul 01, 2022Silver ContributorI sort of sand-bagged you a little by NOT providing the full syntax, partly because I think learning by trying is more complete than learning by copy-paste. And along the same lines, no one is dumb when they try and don't succeed but keep on trying until they do succeed. That's how we all are on our good days.
Continued success with the project.