I'm having trouble displaying text for 'Nationality' in a table. I can display the correct row ID (using the below SQL) but not the text. I'm sure I'm overlooking something simple:
Here's my SQL code:
And here are my look up tables:
If I try adding:
I get an error.
As you can see my countries table has Countries in one column and Nationalities in another. I'd rather not have to make a separate look up table for nationalities if possible.
Thanks for your help.
James
Here's my SQL code:
Code:
SELECT Recruiters.RecruiterID, Recruiters.FirstName, Recruiters.LastName, JobTitles.JobTitle, Recruiters.City, States.State, Countries.Country, Recruiters.Nationality FROM dbo.Recruiters, dbo.JobTitles, dbo.States, dbo.Countries WHERE dbo.Recruiters.JobTitleID = dbo.JobTitles.JobTitleID AND dbo.Recruiters.StateID = dbo.States.StateID AND dbo.Recruiters.CountryID = dbo.Countries.CountryID
Code:
SELECT StateID, State FROM dbo.States SELECT CountryID, Country FROM dbo.Countries SELECT CountryID, Nationality FROM dbo.Countries
Code:
AND dbo.Recruiters.Nationality = dbo.Countries.Nationality
As you can see my countries table has Countries in one column and Nationalities in another. I'd rather not have to make a separate look up table for nationalities if possible.
Thanks for your help.
James
Comment