Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing records(Using A Suppression File)

Status
Not open for further replies.

dryben

Technical User
Jan 3, 2007
4
US
I have File A and File B. Anyone on File B I want to remove from File A. How can I do this?
 
Hello:

Have you tried a Find Duplicates query?. The wizard will step you through the process.

Regards
Mark
 
Does'nt that only work if you want duplicates in the same file. I need to apply a suppresionf file.
 
Hello:

What you then want to do is the "Unmatched" query. below is an example:

SELECT tblZtable1.EmployeeID, tblZtable1.LastName, tblZtable1.FirstName
FROM tblZtable1 LEFT JOIN tblZtable2 ON tblZtable1.EmployeeID = tblZtable2.EmployeeID
WHERE (((tblZtable2.EmployeeID) Is Null));

Regards
Mark
 
Provided your tables [File A] and [File B] share the same PrimaryKey:
DELETE * FROM [File A]
WHERE PrimaryKey In (SELECT PrimaryKey FROM [File B]

Another way:
DELETE A.*
FROM [File A] AS A INNER JOIN [File B] AS B ON A.PrimaryKey = B.PrimaryKey

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top