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: - 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
And here are my look up tables: - SELECT StateID, State
-
FROM dbo.States
-
-
SELECT CountryID, Country
-
FROM dbo.Countries
-
-
SELECT CountryID, Nationality
-
FROM dbo.Countries
If I try adding: - AND dbo.Recruiters.Nationality = dbo.Countries.Nationality
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
4 1498 ck9663 2,878
Recognized Expert Specialist
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: -
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
-
And here are my look up tables: - SELECT StateID, State
-
FROM dbo.States
-
-
SELECT CountryID, Country
-
FROM dbo.Countries
-
-
SELECT CountryID, Nationality
-
FROM dbo.Countries
If I try adding: - AND dbo.Recruiters.Nationality = dbo.Countries.Nationality
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
by the looks of this, your Nationality field is in the Countries table, not in Recruiters.your code (Recruiters.Nationality) will give you an error.
try: - SELECT Recruiters.RecruiterID, Recruiters.FirstName, Recruiters.LastName, JobTitles.JobTitle, Recruiters.City, States.State, Countries.Country, Cou ntries.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
-- CK
by the looks of this, your Nationality field is in the Countries table, not in Recruiters.your code (Recruiters.Nationality) will give you an error.
try: - SELECT Recruiters.RecruiterID, Recruiters.FirstName, Recruiters.LastName, JobTitles.JobTitle, Recruiters.City, States.State, Countries.Country, Countries.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
-- CK
Thanks for your assistance CK. Actually my original code was as you suggested (Countries.Nationality) but for some reason it's not producing the right nationality. When I changed it to Recruiters.Nationality the correct row was selected but only the ID number would dislplay. What seems intuitive to me (and follows the same logic as - AND dbo.Recruiters.CountryID = dbo.Countries.CountryID
is to add: - AND dbo.Recruiters.Nationality = dbo.Countries.Nationality
since I have a Nationality column (int) in my Recruiters table. However, when I execute the code it throws an error.
Is there another approach to solving this problem?
Thanks again,
James
ck9663 2,878
Recognized Expert Specialist
Thanks for your assistance CK. Actually my original code was as you suggested (Countries.Nationality) but for some reason it's not producing the right nationality. When I changed it to Recruiters.Nationality the correct row was selected but only the ID number would dislplay. What seems intuitive to me (and follows the same logic as - AND dbo.Recruiters.CountryID = dbo.Countries.CountryID
is to add: - AND dbo.Recruiters.Nationality = dbo.Countries.Nationality
since I have a Nationality column (int) in my Recruiters table. However, when I execute the code it throws an error.
Is there another approach to solving this problem?
Thanks again,
James
would you mind posting here the code that you have that shows the ID and post the other code that give you an error and also the error that you're seeing...
-- CK
would you mind posting here the code that you have that shows the ID and post the other code that give you an error and also the error that you're seeing...
-- CK
Hi CK,
Thanks for your attention. I decided to just make another lookup table which solved the problem.
Cheers,
James
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: David Opstad |
last post by:
I have a question about text rendering I'm hoping someone here can
answer. Is there a way of doing linguistically correct rendering of
Unicode strings in Python? In simple cases like Latin or...
|
by: Philip Meyer |
last post by:
1) setting image as Background with alignment in center not
working..help
Explanation :
i need to set a image as background and also it should be
dispalyed in the center.i am using apache fop...
|
by: ST |
last post by:
Hello, I will be posting 2 errors that I just can't seem to figure out (I'll
put them in different posts). I have looked all over the internet, and I
still can't figure these out! This webapp was...
|
by: Esteban404 |
last post by:
I've tried many conversions to get the values to be accepted, but none are
working and the subject error message is returned for Parse and ToInt32. I
haven't figured out what "format" is wrong. I'm...
|
by: Shadow Lynx |
last post by:
Consider this simple HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 STRICT//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>...
| |
by: pamela fluente |
last post by:
Hello, for the following code, VS suggests that construct (width=
height= ) is out of date and a newer one
is recommended:
<table><tr><td width="92" height="38" valign="middle">AnyThing</td></...
|
by: kang jia |
last post by:
hi
currently i am editing signup page, when user enter deupicated NRIC and click signup, they will go to do_signuppage and read the error message and then after 5 seconds, they will be redirected...
|
by: kang jia |
last post by:
hi
when user entered particulars in signuppage and click" signup" button, i will direct them to do_signup.php. if say the NRIC is dupicate in datebase, i will redirect them back to signup page...
|
by: Anthony Planz |
last post by:
Hello,
I have a problem with displaying Greek fonts in a content placeholder.
The Masterpage content displays correct, the content inside the content
placeholder not.
Example:...
|
by: differentsri |
last post by:
THIS IS AN ASP.NET 1.1 APPLICATION IAM TRYING TO UPDATE THE FIELD BUT I AM NOT ABLE TO UPDATE IT?
CAN U TELL THE REASON ?
IT IS GIVING THE FOLLOWING ERROR
BELOW I HAVE ALSO GIVEN THE CODE OF...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |