...

View Full Version : Join expression not supported



bostjank
09-30-2005, 07:56 AM
Hello!

I'm haveing problems constructing JOIN part of my SELECT statement (in MS Access) - I have 2 tables, one with list of persons and one with list of countries. In persons table there are 2 columns that contain country code.


PERSONS COUNTRIES
--------- -----------
PersonID CountryID
... CountryName
Country1ID
Country2ID

I have constructed JOIN like the one below, but i ceep getting "Join expression not supported" error.


...FROM
(persons LEFT JOIN countries ON persons.Country1ID = countries.CountryID)
LEFT JOIN countries ON persons.Country2ID = countries.CountryID
Any idea?

Thanks,
Bostjan

ruchit
09-30-2005, 09:21 AM
try this


.... FROM (persons AS p LEFT JOIN Countries AS c1 ON c1.CountryID=p.Country1ID) LEFT JOIN Countries AS c2 ON c2.CountryID=p.Country1ID

bostjank
09-30-2005, 09:26 AM
I have tried this, but i get "Type mismatch in expression." error

ruchit
09-30-2005, 09:30 AM
try printing this statement and run he resultant query directly from query analyser... if it works fine.. then problem is probably somewhere else... which seems to be the case from the error that you've posted.

bostjank
09-30-2005, 09:46 AM
It now works - thanks.
I made a typing mistake.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum