I'm currently working with 3 tables: tblOwner, tblAnimal, tblVisit. I want to join the three of them based on ownerid (which connects tblOwner and tblAnimal) and animalid (which connects tblAnimal and tblVisit). What I'm trying to do exactly is create a query (in MS Access) that only shows firstname, lastname, city, state (from tblOwner), as well as the reason/diagnosis (from tblVisit) only for animals that are injured. I have to use tblAnimal due to animalid, which allows me to indirectly connect tblOwner to tblVisit. I've found multiple ways to inner join 3 tables but none seem to work. Thank you in advance
When I try to run the code, I get the following error: syntax error (missing operator) in query expression "o.ownerid = a.ownerid INNER JOIN tblVisit AS v ON v.animalid = a.animali"
SELECT o.firstname, o.lastname, o.city, o.state, a.animalname, v.reason/diagnosis, v.animalid
FROM tblOwner as o
INNER JOIN tblAnimal AS a ON o.ownerid = a.ownerid
INNER JOIN tblVisit AS v ON v.animalid = a.animalid
WHERE v.reason/diagnosis LIKE "%Injured%"
ORDER BY o.firstname;