Question Comparing to tables in a Query

teric2

Registered User.
Local time
Today, 13:12
Joined
Feb 20, 2010
Messages
32
Comparing two tables in a Query

Good Evening All!
I have 2 tables structurally exactly the same. Named "First Check" and "Second Check" used to take inventory.
I have them joined in a query by an "item number" field. Each table has a "quantity" field. I need to compare the 2 tables and find items where the total quantitys do not match.
My problem is that the "first check" may contain more rows then the "second check" or vice versa because of the way the data was entered. meaning the total qtys could match but not row by row. Is there a way to sub total by item in a query and then compare the totals?

Thanks in advance for any help.
 
Last edited:
Create 2 queries generating the subtotals, then another query which queries those two tables joined by item and subtracting row totals. If a total is not 0, the checks don't match.
 
Create 2 queries generating the subtotals, then another query which queries those two tables joined by item and subtracting row totals. If a total is not 0, the checks don't match.

Thank you for responding!
How do you create subtotals in a query?
 
Open the query in the design view, click the "sigma" symbol in the toolbar (Group BY); then set the "Total:" row under the check1 & check2 columns to "Sum", the item name/number column should be "Group By."
 
I think this will do what I need.

Can't thank you enough.
Thanks for taking the time to reply and have a good weekend!
 

Users who are viewing this thread

Back
Top Bottom