double inner join

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
aannanAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
MamineConnect With a Mentor Commented:
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
 
broesiCommented:
Hi,

what exactly does the error message say?

broesi
0
 
Jupiler78Connect With a Mentor Commented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
MamineCommented:
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
 
aannanAuthor Commented:
error says its a syntax error and there is a missing operator.
0
 
Jupiler78Commented:
Have you tried the solution I put here and the one Mamine put here?
0
 
aannanAuthor Commented:
I have tried both still getting the same error.
0
 
MamineCommented:
Have you got the semi-colon at the end of the statement ?
0
 
MamineCommented:
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
 
broesiCommented:
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
 
aannanAuthor Commented:
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
 
aannanAuthor Commented:
Found it! Added a few more brackets and changed some names. Thanks
0
 
MamineCommented:
Hehe glad you got it working :)
0
 
Jupiler78Commented:
Glad I've been of a help to you
0
All Courses

From novice to tech pro — start learning today.