antifashionpimp
Registered User.
- Local time
- Today, 07:34
- Joined
- Jun 24, 2004
- Messages
- 137
Hi,
I have the following table structure:
tblPeople
---------
PeopleID 'primary key
Name
tblQuestionInst
---------------
InstID 'primary key
PeopleID 'foreign key to tblPeople, 1 to many relationship
tblQuestionInst contains records with PeopleID from tblPeople, and tblPeople contains all possible PeopleID's
I want a query that will display the PeopleID and Name of all records in tblPeople which are NOT in tblQuestionInst.
I tried the following SQL, but it gives me no results:
Somewhere my logic is not catching on
can somebody please help?
Thanks in advance
I have the following table structure:
tblPeople
---------
PeopleID 'primary key
Name
tblQuestionInst
---------------
InstID 'primary key
PeopleID 'foreign key to tblPeople, 1 to many relationship
tblQuestionInst contains records with PeopleID from tblPeople, and tblPeople contains all possible PeopleID's
I want a query that will display the PeopleID and Name of all records in tblPeople which are NOT in tblQuestionInst.
I tried the following SQL, but it gives me no results:
Code:
SELECT tblPeople.PeopleID, tblQuestionInst.PeopleID, tblPeople.Name
FROM tblPeople INNER JOIN tblQuestionInst ON tblPeople.PeopleID = tblQuestionInst.PeopleID
WHERE (((tblPeople.PeopleID) Not In (SELECT tblQuestionInst.PeopleID from tblQuestionInst)));
Somewhere my logic is not catching on
can somebody please help?
Thanks in advance