Problem joining 3 tables

When I try joining 3 tables, I get the following message;

Error Executing Database Query.  
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'm.mstDeptId = d.dptId LEFT OUTER JOIN branch b ON m.mstBranchId = b.brcId'.  

My query looks like this;

 SELECT m.mstFname, m.mstLname, {fn LEFT(m.mstLname, 1)} AS Initial, m.mstPhone, d.dptName, b.brcName
    FROM master m
        LEFT OUTER JOIN department d
              ON m.mstDeptId = d.dptId
        LEFT OUTER JOIN branch b
              ON m.mstBranchId = b.brcId
  ORDER BY m.mstLname

What am I doing wrong? I'm currently using Coldusion MX 6.1.

Thanks,

Errol Farro
Errol FarroAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pinaldaveCommented:
hello,
This may sound stupid but whenever I have this problem I do this....and works for me... please try and let me tknow...

SELECT m.mstFname, m.mstLname, {fn LEFT(m.mstLname, 1)} AS Initial, m.mstPhone, d.dptName, b.brcName
    FROM master m
       LEFT OUTER JOIN department d
            ON (m.mstDeptId = d.dptId)
       LEFT OUTER JOIN branch b
            ON (m.mstBranchId = b.brcId)
  ORDER BY m.mstLname
0
Errol FarroAuthor Commented:
No, I already tried it as you are recommending but I get the same error message.
0
mrichmonCommented:
In access you usually need to put parenthesis around multiple joins so it knows what order to do the joins.

Try this:
 SELECT m.mstFname, m.mstLname, {fn LEFT(m.mstLname, 1)} AS Initial, m.mstPhone, d.dptName, b.brcName
    FROM ((master m
       LEFT OUTER JOIN department d
            ON m.mstDeptId = d.dptId)
       LEFT OUTER JOIN branch b
            ON m.mstBranchId = b.brcId)
  ORDER BY m.mstLname

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Errol FarroAuthor Commented:
Thanks a million. This has solved my problem.
Best Regards,

Errol Farro
Aruba
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.