D
dchendrickson
I am running Access2002 / XP Pro.
The query forum is down right now so I posted here.
I need some help jumpstarting my brain. I need to build
an SQL for a listbox. The query needs to find records NOT
found in another table. The structure is like this:
tblMain has an MainID field that is an autonumber and
some other fields. tblDetails is a subdatasheet to
tblMain and is linked through the MainID. In tblDetails,
MainID and OtherID form the Primary Key. Not every entry
in tblMain will have an entry in tblDetails.
I need an SQL statement that will find all the records in
tblMain that do NOT have an entry in tblDetails.
I know how to get all the records that DO have
corresponding entries in tblDetails:
SELECT m.MainID FROM tblMain AS m INNER JOIN tblDetails
AS d ON m.MainID = d.MainID;
Where does the 'NOT' fit into this?
Thanks (it has to be a Monday)!
-dc
The query forum is down right now so I posted here.
I need some help jumpstarting my brain. I need to build
an SQL for a listbox. The query needs to find records NOT
found in another table. The structure is like this:
tblMain has an MainID field that is an autonumber and
some other fields. tblDetails is a subdatasheet to
tblMain and is linked through the MainID. In tblDetails,
MainID and OtherID form the Primary Key. Not every entry
in tblMain will have an entry in tblDetails.
I need an SQL statement that will find all the records in
tblMain that do NOT have an entry in tblDetails.
I know how to get all the records that DO have
corresponding entries in tblDetails:
SELECT m.MainID FROM tblMain AS m INNER JOIN tblDetails
AS d ON m.MainID = d.MainID;
Where does the 'NOT' fit into this?
Thanks (it has to be a Monday)!
-dc