By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,456 Members | 1,251 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,456 IT Pros & Developers. It's quick & easy.

Excluding records where two tables have the same id

P: n/a
Please help. I've been ramming my head on my keyboard from trying to
figure this problem out.
In a query, I have two tables. One of the tables (table 1) has a unique

identifier and other fields regarding the characteristics of that
record. In the other table (table 2), I have another list of unique
identifiers only. All unique identifiers in this table (table 2)are
contained in the first table. My goal is to exclude any records that
are in table 2 from the list in table 1.
Thanks for any help anyone is able to provide!

Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
he**********@hotmail.com wrote:
Please help. I've been ramming my head on my keyboard from trying to
figure this problem out.
In a query, I have two tables. One of the tables (table 1) has a unique

identifier and other fields regarding the characteristics of that
record. In the other table (table 2), I have another list of unique
identifiers only. All unique identifiers in this table (table 2)are
contained in the first table. My goal is to exclude any records that
are in table 2 from the list in table 1.
Thanks for any help anyone is able to provide!

Well, you could create a new query (Query/New/Design). Select table1
and table2. Drag/create relationship lines between Table2 and Table1
for the fields that define the uniqueness. Lets say you have fields f1,
f2, and f3 in both tables that create a unique record. Create the
relationship between those three fields. Now dbl-click on each
relationship line and select (most likely) option 2 to select all
records in Table1 and those that match in Table2. Now drag down F1..F3
in Table1 and F1..F3 in table 2. In the criteria row for F1..F3 in
Table2 enter
Is Null
and now run it. This will display all recs in Table1 that don't have a
similar record in Table2.

You might be able to create this by doing a Query/New/Missing Record.
Nov 13 '05 #2

P: n/a
he**********@hotmail.com wrote:
Please help. I've been ramming my head on my keyboard from trying to
figure this problem out.
In a query, I have two tables. One of the tables (table 1) has a unique

identifier and other fields regarding the characteristics of that
record. In the other table (table 2), I have another list of unique
identifiers only. All unique identifiers in this table (table 2)are
contained in the first table. My goal is to exclude any records that
are in table 2 from the list in table 1.
Thanks for any help anyone is able to provide!

Well, you could create a new query (Query/New/Design). Select table1
and table2. Drag/create relationship lines between Table2 and Table1
for the fields that define the uniqueness. Lets say you have fields f1,
f2, and f3 in both tables that create a unique record. Create the
relationship between those three fields. Now dbl-click on each
relationship line and select (most likely) option 2 to select all
records in Table1 and those that match in Table2. Now drag down F1..F3
in Table1 and F1..F3 in table 2. In the criteria row for F1..F3 in
Table2 enter
Is Null
and now run it. This will display all recs in Table1 that don't have a
similar record in Table2.

You might be able to create this by doing a Query/New/Missing Record.
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.