Jump to content

SQL INTERSECT alternatives in Access


dBrococo

Recommended Posts

I'm trying to find the intersection of two SELECT queries.My SQL statement would read as follows if Access supported INTERSECT (which it doesn't appear to):~~~~SELECT * FROM(Table1 INNER JOIN Table2 On Table1.A = Table2.B) INNER JOIN Table3 ON Table2.C = Table3.DWHERE (Table1.X = True) AND (Table3.Y = True)INTERSECTSELECT * FROM (Table1 INNER JOIN Table2 On Table1.A = Table2.B) INNER JOIN Table3 ON Table2.E = Table3.DWHERE (Table1.X = True) AND (Table3.Y = True)~~~~However, this code produces the following error: "Method 'Open' of object '_Recordset' failed." Are there alternative ways to perform this intersection in a single query? I read a few posts that suggested using LEFT JOIN, but I am not sure about how to combine a left join w/ the inner joins I am using to retrieve my data.Thanks very much for your help!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...