Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Syntax error in Access Query

Author  Topic 

azamsharp
Posting Yak Master

201 Posts

Posted - 2005-12-21 : 12:21:35
I am using MS Access Database and writing this query which is always giving me syntax error.

SELECT tblLocation.LocationID, tblLocation.LocationName,tblLocation.Address,tblLocation.State,tblLocation.City,tblLocation.ZipCode,tblLocation.ReferenceName FROM tblLocation
INNER JOIN tblUserLocation ON tblLocation.LocationID = tblUserLocation.LocationID AND INNER JOIN tblUser ON tblUser.UserID = tblUserLocation.UserID

The Syntax error only comes when I add the second JOIN condition.

Mohammad Azam
www.azamsharp.net

jhermiz

3564 Posts

Posted - 2005-12-21 : 13:04:52
Get rid of the AND



Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]

RS Blog -- [url]http://weblogs.sqlteam.com/jhermiz[/url]
Go to Top of Page

azamsharp
Posting Yak Master

201 Posts

Posted - 2005-12-21 : 13:15:48
Thanks for the reply. I removed the AND and my query looks something like this now:

SELECT tblLocation.LocationID, tblLocation.LocationName,tblLocation.Address,tblLocation.State,tblLocation.City,tblLocation.ZipCode,tblLocation.ReferenceName FROM tblLocation
INNER JOIN tblUserLocation ON tblLocation.LocationID = tblUserLocation.LocationID INNER JOIN tblUser ON tblUser.UserID = tblUserLocation.UserID

Now it says "Missing Operater in the Query Expression tblLocation.LocationID = tblUserLocation.LocationID INNER JOIN tblUser ON tblUser.UserID = tblUserLocation.UserID

Any ideas!

Mohammad Azam
www.azamsharp.net
Go to Top of Page
   

- Advertisement -