Query to Find Unmatched Records Between Two FilesLast reviewed: September 2, 1997Article ID: Q114150 |
The information in this article applies to:
SUMMARYThis article describes how to create a Subtract query that compares two tables and returns a result set that includes only those records from the first table that do not have matching records in the second table.
MORE INFORMATION
Overview of the Subtract Query ProcedureTo perform a Subtract query, create an outer join that joins the two tables, and then add a condition to the query that filters out all of the matching records.
Example of the Subtract Query ProcedureThis example uses the sample files that ship with Microsoft Excel 5.0. The default location for these files is WINDOWS\MSAPPS\MSQUERY. If these file are not installed on your system, run Microsoft Excel 5.0 Setup and install Microsoft Query again. In this example, the source table (CUSTOMER.DBF) and the destination table (EMPLOYEE.DBF) are the two files that you want to join. The destination table is the table that contains the unmatched records. (Note that the following query results in a new table. The contents of the source and destination tables are left unchanged.)
WARNING: Your use or modification of the SQL statement provided in this article is at your own risk. Microsoft provides this SQL statement "as is" without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. Microsoft does not support modifications of the SQL statement to suit specific customer requirements.
REFERENCES"Microsoft Query User's Guide," version 1.0, Chapter 6, "What Join Lines Are And How They're Created" For more information about Joins, choose the Search button in Help and type:
Join |
Additional query words: 5.00 1.00 query subtract match unmatched
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |