Updating "Bad" Records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table (tblOne) that has 10 records. I have another table (tblTwo) that has 5 records that are a subset of TblOne. I want to remove the 5 records in TblOne that are NOT in TblTwo. One problem, no unique record identifier(s) in either records that can be combined to distinguish them.

Any suggestions are welcome, thanks.

G
 
How do you identify the 5 "subset" records as being the same as the ones in
the tblOne table?

Assuming that you have three fields in each table (Field1, Field2, Field3)
and when they're the same you don't want to delete the records, a delete
query similar to this might work for you:

DELETE O.* FROM tblOne AS O
LEFT JOIN tblTwo AS T
ON O.Field1 = T.Field1 AND O.Field2 =
T.Field2 AND O.Field3 = T.Field2
WHERE T.Field1 Is Null;

--
Ken Snell
<MS ACCESS MVP>

G said:
I have a table (tblOne) that has 10 records. I have another table
(tblTwo) that has 5 records that are a subset of TblOne. I want to remove
the 5 records in TblOne that are NOT in TblTwo. One problem, no unique
record identifier(s) in either records that can be combined to distinguish
them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Adding New records in multiple tables 2
query substitution 4
Relationships 1
Union Query??? 1
Append Queries and Autonumbers 2
Go To Record 1
update method 3
set control value = to subform control value 1

Back
Top