Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Joining 3 tables

Author  Topic 

anishap
Yak Posting Veteran

61 Posts

Posted - 2009-09-03 : 13:14:53
I'm trying to join 3 tables using right outer join. I got the below error message

Syntax error missing operator in query field 'AS e ON e.eid = r.eid RIGHT OUTER JOIN Fittest f on e.eid = f.eid'

I need all rows from Respirator table, Fittest table based on the EID from resident_2009 table

SELECT e.eid, e.lname, e.fname, r.date AS Resp_date, r.n95mask, f.date AS fit_date, f.respirator, f.result
FROM respirator AS r RIGHT JOIN Resident_2009 AS e ON e.eid = r.eid RIGHT OUTER JOIN Fittest f on e.eid = f.eid;

Can anyone help me on this?

anishap
Yak Posting Veteran

61 Posts

Posted - 2009-09-03 : 13:22:42
I think it worked using the below query

SELECT e.eid, e.lname, e.fname, r.date AS Resp_date, r.n95mask, f.date AS fit_date, f.repirator, f.result
FROM (respirator AS r RIGHT JOIN UWMC_Resident_2009 AS e ON e.eid = r.eid) left JOIN Fittest f on e.eid = f.eid;
Go to Top of Page
   

- Advertisement -