Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Problem joining 3 tables

Posted on 2004-10-25
4
Medium Priority
?
166 Views
Last Modified: 2013-12-24
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
0
Comment
Question by:Errol Farro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 21

Expert Comment

by:pinaldave
ID: 12400273
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
 

Author Comment

by:Errol Farro
ID: 12400469
No, I already tried it as you are recommending but I get the same error message.
0
 
LVL 35

Accepted Solution

by:
mrichmon earned 500 total points
ID: 12401110
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
 

Author Comment

by:Errol Farro
ID: 12401545
Thanks a million. This has solved my problem.
Best Regards,

Errol Farro
Aruba
0

Featured Post

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question