Replicating Data issue

abm1203

New Member
Joined
Aug 28, 2017
Messages
4
All,

Hopefully this is the correct forum for this question.

I am working with some older systems and trying to automate some data collection. So far, for background, my path is:

(1) there are (14) .txt files that are saved daily from our production floor (one file per machine) - saved to a shared folder
(2) I have a macro written that grabs one days worth of .txt files and pulls them into an Excel sheet
(3) I have an index function written to put all of the days data into a traditional data format
(4) the macro then imports the days data into an Access table for storage and manipulation

The data are pulled correctly into my Access table. The data are formatted into six fields:

(1) ID (autonumber, primary key)
(2) Date field (short date format)
(3) Machine number (short text format)
(4) Test type (short text format)
(5) Part number (short text format)
(6) Result (number, double format)

Each day, for each machine, there are multiple parts tested and different test results for each, IE

9/18/2017, Machine 21, Load Test, Part A1, 6.821
9/18/2017, Machine 21, Load Test, Part A2, 6.832
etc and then
9/18/2017, Machine 21, Lateral Test, Part A1, 32.23
9/18/2017, Machine 21, Lateral Test, Part A2, 32.34
etc

The issue is that because moving the data from .txt through Excel to Access is pretty manual, I could have duplicate entries in my Access table.

So, I created a 'Find Duplicates Query' with Date, Machine, Test, and Part all being duplicated - this query finds the duplicates well. I then modified this to a delete query - and it does its job (lol).

However, the issue is that I lose all the data that are duplicated. I need to be able to keep one set of the data (first, last. or other, doesn't matter). However, I am not sure how to do it.

Sorry for all the background, but I wasnt sure if there was a more elegant or better way to do this.

Thanks in advance for your time in reviewing this!

Andy
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
instead of deleting data, cant you keep all the data in the table (w dupes)
and run a query to get only the unique records (no dupes) ?

Im not sure what you are calling duplicate. If mach21 has 2 values for that day, where is the dupe?
 
Upvote 0
Ranman256,

Thank you for your response, and I am sorry if I was unclear. If we had a duplicate, it would look like:

9/18/2017, Machine 21, Load Test, Part A1, 6.821
9/18/2017, Machine 21, Load Test, Part A2, 6.832

9/18/2017, Machine 21, Load Test, Part A1, 6.821
9/18/2017, Machine 21, Load Test, Part A2, 6.832

Etc.

I am trying to eliminate the second set of duplicate records from either being entered or out of the table once they are entered.

Thanks,
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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