?
Solved

double inner join

Posted on 2004-10-11
14
Medium Priority
?
582 Views
Last Modified: 2010-05-18
Hi,
I am trying to run this query but i am getting a syntax error. Help Please. thanks

SELECT [Member#],[LastName],[FirstName],[Email] FROM tblMembers INNER JOIN tblEvent ON tblMembers.MemberID = tblEvent.MemberID INNER JOIN tblAvail ON tblMembers.MemberID = tblAvail.MemberID WHERE tblAvail.Days=-1 AND tblEvent.EventSingles=-1
0
Comment
Question by:aannan
[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
  • 5
  • 4
  • 3
  • +1
14 Comments
 
LVL 5

Expert Comment

by:broesi
ID: 12274400
Hi,

what exactly does the error message say?

broesi
0
 
LVL 8

Assisted Solution

by:Jupiler78
Jupiler78 earned 100 total points
ID: 12274405
Hi aannan,

What says the error? You could try this

SELECT [Member#],[LastName],[FirstName],[Email] FROM tblMembers INNER JOIN tblEvent ON [tblMembers].MemberID = [tblEvent].MemberID INNER JOIN tblAvail ON [tblMembers].MemberID = [tblAvail].MemberID WHERE [tblAvail].Days=-1 AND [tblEvent].EventSingles=-1


Cheers!
0
 

Expert Comment

by:Mamine
ID: 12274938
Try putting the first join in brackets:

SELECT [Member#],[LastName],[FirstName],[Email] FROM (tblMembers INNER JOIN tblEvent ON tblMembers.MemberID = tblEvent.MemberID) INNER JOIN tblAvail ON tblMembers.MemberID = tblAvail.MemberID WHERE tblAvail.Days=-1 AND tblEvent.EventSingles=-1
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

Author Comment

by:aannan
ID: 12277121
error says its a syntax error and there is a missing operator.
0
 
LVL 8

Expert Comment

by:Jupiler78
ID: 12277131
Have you tried the solution I put here and the one Mamine put here?
0
 

Author Comment

by:aannan
ID: 12277185
I have tried both still getting the same error.
0
 

Expert Comment

by:Mamine
ID: 12277203
Have you got the semi-colon at the end of the statement ?
0
 

Expert Comment

by:Mamine
ID: 12277241
Have you checked all the column names are correct ? It sounds like there maybe another error here rather than the join being the problem
0
 
LVL 5

Expert Comment

by:broesi
ID: 12277284
My guess is that the # is the problem. Try to rename the field in the table if possible (or create a copy of that table, change the column name there and try the query with the new table).

broesi
0
 

Author Comment

by:aannan
ID: 12277307
Yep have semi-colon at the end. Do you think it has anything to do because I am running  the query in the SQL builder in access? the query looks fine to me unless theres is some detail i am missing
0
 

Accepted Solution

by:
Mamine earned 100 total points
ID: 12277342
Should be fine in SQL builder buut is always worth trying to display in Design mode too - that way it will show up any syntax errors before you try to run the query. If you can't display it in Design mode then try re-entering the query in Design mode a step at a time.
0
 

Author Comment

by:aannan
ID: 12277357
Found it! Added a few more brackets and changed some names. Thanks
0
 

Expert Comment

by:Mamine
ID: 12277369
Hehe glad you got it working :)
0
 
LVL 8

Expert Comment

by:Jupiler78
ID: 12284285
Glad I've been of a help to you
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

777 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