Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Synax error in from clause 1

Status
Not open for further replies.

simon551

IS-IT--Management
May 4, 2005
249
Hi,
I have a members table and a contact table. I'm trying to pull the information from the contact table twice. You see that I have a left join where contacttype is 1 and a left join where contacttype is 2. I'm running into problems getting the second left join to work. Any help is appreciated


SELECT tblMembers.*, Primary.[FirstName] & " " & Primary.[LastName] AS PCName, Primary.Phone, Primary.Email, Primary.Country, tblMembers.Expired
FROM (tblMembers (LEFT JOIN (Select * From tblContacts WHere ContactType=1) AS Primary ON tblMembers.MemberID = Primary.MemberID) LEFT JOIN ((Select * From tblContacts WHere ContactType=2) AS Secondary));

Thanks,
s
 
Code:
SELECT tblMembers.*, Primary.[FirstName] & " " & Primary.[LastName] AS PCName, Primary.Phone, Primary.Email, Primary.Country, tblMembers.Expired

FROM (tblMembers 
      LEFT JOIN 

      (Select * From tblContacts 
       Where ContactType=1) AS Primary 
 
     ON tblMembers.MemberID = Primary.MemberID)

     LEFT JOIN (Select * From tblContacts 
                Where ContactType=2) AS Secondary

     [red]ON Secondary.??? = ???.???[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top