Importing Data

thepasmiths

New Member
Joined
Mar 20, 2023
Messages
11
Office Version
  1. 365
Platform
  1. Windows
I get a spreadsheet each week that has multiple invoice numbers and each invoice number might have multiple line numbers.
I have imported the data into a table.
Is there a way to import and update the data each week? prices and dates, etc might change week to week.
I have other fields in the record that I don't want to change.
 
Okay, thank you. It might take me awhile to implement it, but I'll let you know if I have any problems.
 
Upvote 0

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
I'm having a problem on step 2, finding the duplicates.

Can you walk me through the process?
 
Upvote 0
New Data:

CompanyInvoice NumberLine NumberPart NumberPriceDue DateCostNotes
ABC Company1529461HE19031.993/31/20230.52Attach to part 31644
ABC Company1529463
548​
12.994/6/20232
ABC Company15294610
548​
6.994/22/20231.7
DEF Company294681M25564-1248.994/16/20231.9
DEF Company264926H542258.254/1/20231.6
HGI, Inc26529124C-0327.994/22/20231.55
HGI, Inc26530132C-0248.994/22/20231.75
 
Upvote 0
Do you how to do a matched query in Access?
You need to join the two table on the field(s) that identify the unique records (may be one of more fields).
You could then try to identify other field values that might have changed through a series of criteria of each field (i.e. Field1 from Table1 not equal to Field1 from Table2), or simply just overwrite the whole record with the new values.
 
Upvote 0
No, I am having problems with the matched query.
You combine both tables (append one to the other), and then do a find duplicates query?
Is it going to be a problem when the invoice number is repeated?
 
Upvote 0
You combine both tables (append one to the other), and then do a find duplicates query?
No, that is not how you do a find duplicates query.
You compare Table A to Table B, joining them on the fields which define a unique record.

In a real simple example, if you had Table A that had two fields, ID and Value, and Table B that also had two fields, ID and Value, and you wanted to find all records where the Value was different, you would:
1. Create a new query
2. Add TableA to the query
3. Add TableB to the query
4. Join TableA to TableB on the ID field
5. Add a criteria condition where [TableA]![Value] <> [TableB]![Value]

This would return all the records where the Value field changed for Users.

If the data on the new record is always correct and complete, you don't even need to add a criteria.
You can simply do a matched query following steps 1-4 above.
Then make it an Update Query, updating all the fields to the values from the new record.
Then the new data will overwrite all old data for matching records.
 
Upvote 0
what if there isn't a field that defines a unique record?
But, rather a combination of fields? Invoice Number is repeated from one record to the next, but a secondary field (Line Number), that would then differentiate this record from the last.
Problem being that the secondary field is not unique unto itself, but relies on the primary field to differentiate.

Invoice Number 1 Line 1
Invoice Number 1 Line 2
Invoice Number 1 Line 3
Invoice Number 2 Line 1
Invoice Number 2 Line 2
 
Upvote 0
Like I mentioned in my previous posts, you can join on multiple fields. However many it takes to create a unique record!

The only time that is a problem is if they insert or switch Line numbers between files (i.e. something like if Invoice Number 1 Line 2 on one file really lines up with Invoice Number 1 Line 3 on the other file).
If that can happen, that is a problem (there is only so much you can do with bad data!)
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,909
Members
452,949
Latest member
beartooth91

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