Why this query is not working

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

SELECT * FROM tblUserDetails
LEFT OUTER JOIN tblDesignation ON tblDesignation.DesignationID =
tblUserDetails.DesignationID
LEFT OUTER JOIN tblKnow ON tblKnow.KnowID = tblUserDetails.KnowID
LEFT OUTER JOIN tblType ON tblType.TypeID = tblUserDetails.TypeID
LEFT OUTER JOIN tblCountry ON tblCountry.CountryID = tblUserDetails.CountryID

I had also created Relationship between the table in Microsoft Access.

It is working for first LEFT OUTER JOIN operation (It successfully joins two
tables)
e.g
SELECT * FROM tblUserDetails
LEFT OUTER JOIN tblDesignation ON tblDesignation.DesignationID =
tblUserDetails.DesignationID

else it is gives error. Why?

Waiting for quick reply

Thanks in advance
Hemant Kulkarni
 
Hemant said:
SELECT * FROM tblUserDetails
LEFT OUTER JOIN tblDesignation ON tblDesignation.DesignationID =
tblUserDetails.DesignationID
LEFT OUTER JOIN tblKnow ON tblKnow.KnowID = tblUserDetails.KnowID
LEFT OUTER JOIN tblType ON tblType.TypeID = tblUserDetails.TypeID
LEFT OUTER JOIN tblCountry ON tblCountry.CountryID = tblUserDetails.CountryID

I had also created Relationship between the table in Microsoft Access.

It is working for first LEFT OUTER JOIN operation (It successfully joins two
tables)
e.g
SELECT * FROM tblUserDetails
LEFT OUTER JOIN tblDesignation ON tblDesignation.DesignationID =
tblUserDetails.DesignationID

else it is gives error. Why?

Waiting for quick reply

Thanks in advance
Hemant Kulkarni

You're gonna need some parentheses around the joins, maybe like this:

SELECT * FROM ((((tblUserDetails
LEFT OUTER JOIN tblDesignation ON tblDesignation.DesignationID =
tblUserDetails.DesignationID)
LEFT OUTER JOIN tblKnow ON tblKnow.KnowID = tblUserDetails.KnowID)
LEFT OUTER JOIN tblType ON tblType.TypeID = tblUserDetails.TypeID)
LEFT OUTER JOIN tblCountry ON tblCountry.CountryID =
tblUserDetails.CountryID)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top