Inner Join problem

D

Darhl Thomason

I'm trying to include data from multiple tables on a report. My main table
has OwnerID, RegionID, DistrictID, etc. I have a sub table (tblOwners) with
OwnerID & OwnerName, tblRegion with RegionID & RegionName, tblDistrict with
DistrictID & DistrictName.

I'm trying to get my report to show Owner Name, Region Name, District Name.
If I only use Owner Name, it works fine, the join statement that is not
working (error is "Syntax error in JOIN operation")

strSQL = "SELECT * FROM tblStoreData INNER JOIN " & _
"(tblOwners INNER JOIN (tblRegion " & _
"INNER JOIN (tblDistrict on tblStoreData.DistrictID =
tblDistrict.DistrictID) " & _
"on tblStoreData.RegionID = tblRegion.RegionID) " & _
"on tblStoreData.OwnerID = tblOwners.OwnerID)"

The JOIN statement that does work with only one INNER JOIN is
strSQL = "SELECT * FROM tblStoredata INNER JOIN tblOwners on
tblStoreData.OwnerID = tblOwners.OwnerID"

Thanks!

Darhl
 

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

Top