Hi Chris,
Here are some queries I just created for you. It turns out that I had to
slightly customize the result from the unmatched query wizard, by creating an
additional Left Join. To use these SQL statements, create a new query.
Dismiss the Add Tables dialog without adding any tables. In query design
view, click on View > SQL View. You should see the word SELECT highlighted.
Copy the following SQL statements (Ctrl C) and paste them into the SQL view
(Ctrl V), replacing the SELECT keyword each time:
Suggested name for this query:
qryItemConfigurationWithoutMatchingItemLocations
SELECT [Item Configuration].item_id, [Item Configuration].item_config,
"In Item Configurations, but not in Item Locations." AS [Found]
FROM [Item Configuration] LEFT JOIN [Item Locations]
ON ([Item Configuration].item_config = [Item Locations].item_config)
AND ([Item Configuration].item_id = [Item Locations].item_id)
WHERE ((([Item Locations].item_id) Is Null));
Suggested name for this query:
qryItemLocationsWithoutMatchingItemConfiguration
SELECT [Item Locations].item_id, [Item Locations].item_config,
"In Item Locations, but not in Item Configurations." AS [Found]
FROM [Item Locations] LEFT JOIN [Item Configuration]
ON ([Item Locations].item_config = [Item Configuration].item_config)
AND ([Item Locations].item_id = [Item Configuration].item_id)
WHERE ((([Item Configuration].item_id) Is Null));
You can then switch back to the more familiar design view, if you wish, by
clicking on View > Design View. Run the query. Both of the above queries
should be read / write.
Putting these two results together, using a UNION query, results in a read
only query. Also, you cannot switch to the more familiar design view for
union queries. These types of queries cannot be represented in the Query by
Example (QBE) grid.
Suggested name for this query:
quniNonCorrespondingRecords
SELECT [Item Configuration].item_id, [Item Configuration].item_config,
"In Item Configurations, but not in Item Locations." AS [Found]
FROM [Item Configuration]
LEFT JOIN [Item Locations]
ON ([Item Configuration].item_config = [Item Locations].item_config)
AND ([Item Configuration].item_id = [Item Locations].item_id)
WHERE ((([Item Locations].item_id) Is Null))
UNION
SELECT [Item Locations].item_id, [Item Locations].item_config,
"In Item Locations, but not in Item Configurations." AS [Found]
FROM [Item Locations]
LEFT JOIN [Item Configuration]
ON ([Item Locations].item_config = [Item Configuration].item_config)
AND ([Item Locations].item_id = [Item Configuration].item_id)
WHERE ((([Item Configuration].item_id) Is Null));
Tom Wickerath, Microsoft Access MVP
http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
Tom Wickerath said:
Hi Chris,
This should be fairly easy for you to do, by starting with a wizard that is
included in Access. Select the Queries tab in the database window. Click on
the New button. The last item reads "Find Unmatched Query Wizard". This will
allow you to find records that are present in one table, but not the other.
So, you can go through this wizard two times, to find unmatched records in
each direction. To finish it off, you can "glue" the results of the two
SELECT queries together by creating a Union query, if you don't mind having a
read only result.
Give it a try and post back if you need addtional help.
Tom Wickerath, Microsoft Access MVP
http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________