Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Joins, Missing operator

Status
Not open for further replies.

Tokhra

Programmer
Oct 1, 2003
134
ES
Hey all,

Using Access 2000 im trying to do:

SELECT t1.Field1, t2.Field2, t3.Field3 FROM Table1 AS t1 INNER JOIN Table2 AS t2 ON t1.Field = t2.Field INNER JOIN Table3 AS t3 ON t1.Field = t3.Field WHERE t1.Field = 1 ORDER BY t1.Field

Except access errors saying its missing an operator, if I reduce the query to one INNER JOIN then its fine.

Have I got the syntax wrong? Any Ideas?

Thanks,
Matt.
 
Try this:

SELECT t1.Field1, t2.Field2, t3.Field3 FROM Table1 AS t1 INNER JOIN (Table2 AS t2 ON t1.Field = t2.Field INNER JOIN (Table3 AS t3 ON t1.Field = t3.Field)) WHERE t1.Field = 1 ORDER BY t1.Field

-VJ
 
Hmm...
Try this too

SELECT t1.Field1, t2.Field2, t3.Field3 FROM Table1 AS t1 INNER JOIN (Table2 AS t2 ON t1.Field = t2.Field) INNER JOIN (Table3 AS t3 ON t1.Field = t3.Field) WHERE t1.Field = 1 ORDER BY t1.Field

Observe the parenthesis...

-VJ
 
Hey Amorous,

Thanks for the reply.

I've just tried those and neither work, invalid syntax on join operation :(
 
Try this:

SELECT t1.Field1, t2.Field2, t3.Field3 FROM Table1 AS t1 (INNER JOIN Table2 AS t2 ON t1.Field = t2.Field INNER JOIN Table3 AS t3 ON t1.Field = t3.Field) WHERE t1.Field = 1 ORDER BY t1.Field

Observe the parenthesis...

Your error...missing an operator is referring to a missing parenthesis...

-VJ
 
You may also try this:
SELECT t1.Field1, t2.Field2, t3.Field3
FROM Table1 AS t1, Table2 AS t2, Table3 AS t3
WHERE t1.Field = 1 AND t2.Field = t1.Field AND t3.Field = t1.Field
ORDER BY t1.Field

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top