Tuesday 28 January 2014

Multiple JOINs with Missing Operator Issue in MS Access

Join is used to retrieve rows from two or more tables by matching a field value that is common between the tables. The fields you join on must have similar data types, and you cannot join on MEMO or OLEOBJECT data types

if you want to do more than one JOIN, you have to use parenthesis in the FROM clause.

SELECT ...
FROM MainTable
JOIN JointTable1 ON ...
JOIN JointTable2 ON ...
JOIN JointTable3 ON ...

you would have to do the following:

SELECT ...
FROM ((MainTable
JOIN JointTable1 ON ...)
JOIN JointTable2 ON ...)
JOIN JointTable3 ON ...

the joins must be nested by using parentheses

Otherwise, you get a "Missing Operator" error.

No comments:

Post a Comment