comparison database

lemonap618

New Member
Joined
Oct 26, 2012
Messages
33
Hello All,
I hope this message finds everyone well.
I admittedly know very little about Access so I have come here for help.

Problem: I need to compare two Excel files by invoice number and invoice sum. I need the output to show the invoices that are contained in one file but not the other, and the invoices where the invoice sum does not match. One caveat is, the first file is at an invoice level while the second is at a line item level. So to accurately compare, I need Access to aggregate the sum of the line item file and then compare to the invoice file.

I hope I'm not being super confusing. Any and all help is much appreciated!!!!
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
It would be beneficial to see what your data looks like, to see how it is structured.

I need the output to show the invoices that are contained in one file but not the other, and the invoices where the invoice sum does not match.
Access actually has a built-in Unmatched Query Wizard to walk you through this process.
However, you may have to create a query first to get your data in workable format, before using this. That really depends on what your data looks like.

I admittedly know very little about Access so I have come here for help.
If you have no knowledge of how to create queries in Access, it is going to be very difficult to help you. I recommend taking a few minutes to read up on them first.
Here are some links to get you started:
https://support.office.com/en-us/ar...ct-query-de8b1c8d-14e9-4b25-8e22-70888d54de59
https://www.youtube.com/watch?v=tpIPWIDcMTo

There are many more you can find with Google or YouTube searches.

Start there, and see how you do. If you run into trouble and need help, post small sample of your data so we can see what it looks like and fully understand what you mean when you say:
One caveat is, the first file is at an invoice level while the second is at a line item level. So to accurately compare, I need Access to aggregate the sum of the line item file and then compare to the invoice file.
You may need to do an Aggregate (Totals) Query first to roll up those records into a single record per invoice.
(You can search "Aggregate (Totals) Query in Access" too).
 
Last edited:
Upvote 0
Hi Joe,
Thank you so much for your response.
Below is a snapshot of my two Excel workbooks.


I have loaded the data in Access, defined my primary key (invoice), and created a relationship between the two workbooks.
I believe I can create a query on my own that shows invoices that are in the first file, but not in the second; however, I also need to see which invoices are contained in both workbooks but do not have the same invoice amount. Can you help guide me through that?

All help is much appreciated!
 
Upvote 0
For the other query, just do a simple query joining the two Tables together on your Invoice Number field.
Then, place Criteria where the amount of the Invoice from the second is difference from the first.

Let's say that your Tables (or Queries) are named Table1 and Table2, and the amount field is named "Amount" in each table.
Then, in your query, under the Table1 Amount field, add this on the Criteria line:
Code:
<> [Table2]![Amount]

Here is a link on adding Criteria to queries: https://support.office.com/en-us/ar...criteria-3197228c-8684-4552-ac03-aba746fb29d8
 
Upvote 0
Hi Joe,
thank you so much for your time.
I have followed your steps and have joined the two tables together based on the invoice number field....thank you!
Two quick requests - can you show me a quick screen shot of where to add the Code in Access you presented above? Also, could you show me a screenshot as to where you initiate an aggregate query as one of my tables is at the line item level?
This would help me out tremendously!

Thanks for your time!
 
Upvote 0
Two quick requests - can you show me a quick screen shot of where to add the Code in Access you presented above?
The link I provided in that reply has screen shots showing exactly where/how to add the Criteria to the Query.

Also, could you show me a screenshot as to where you initiate an aggregate query as one of my tables is at the line item level?
Just go to the Query section. An Aggregate Query is a type of query.

Here is a link on Aggregate Queries: https://support.office.com/en-us/ar...uery-b84cdfd8-07ba-49a7-b067-e1024ccfcca8#bm3
They walk you how to set one up under "Count all records in a query". Just choose the "Sum" function instead of the "Count" function to do what you want.
 
Upvote 0
What was the exact error message?
It won't hurt to put an Autonumber field at the end of your table, and let this be the primary key.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,699
Members
449,048
Latest member
81jamesacct

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top