PDA

Click to See Complete Forum and Search --> : Help with SQL Statement


fowlerjp
Feb 19th, 2000, 09:37 PM
Help with SQL Statement

No SQL genius here but I thought I was doing something simple. I am trying to INNER JOIN 3 tables. I got 2 tables to work, but the third dies and gives me (Syntax Error) Missing Operator. Here is what I have any help is greatly appreciated.

This Works:
SELECT Field1, Field2, Field3 FROM Table1 INNER JOIN Table2 ON Table1.ID = Table2.ID

This Does Not:
SELECT Field1, Field2, Field3 FROM Table1 INNER JOIN Table2 ON Table1.ID = Table2.ID INNER JOIN Table3 ON Table1.ID = Table3.ID

Is this possible?

Chris
Feb 19th, 2000, 10:32 PM
May be you can try out this:

SELECT Field1, Field2, Field3 FROM ((Table1 INNER JOIN Table2 ON Table1.ID = Table2.ID) INNER JOIN Table3 ON Table1.ID = Table3.ID)


_______________________
Chris.C :)
ccthou@yahoo.com

[This message has been edited by Chris (edited 02-21-2000).]

fowlerjp
Feb 20th, 2000, 04:58 AM
Thanks!

j_lyver
Feb 22nd, 2000, 06:45 AM
If you are having problems with sql statements what i do is that i create them is access and view the query in the sql form and copy and paste in the visual basic code form. That will solve the syntax errors