Deleting Duplicates Question (1 Viewer)

MatthewH

Registered User.
Local time
Today, 05:40
Joined
Jan 12, 2017
Messages
49
Hey everyone,

I have a file that will be searching for new data from a daily file and appending it to a master. If I use an Unmatching Query or delete duplicates, will it pull in the most recent record or the old record? I ask this because my OLD record will have comments added to it but I want the new record not to append as long as it matches up on a unique identifier (even though it will be different by one field (the comments I add)).

Any help is appreciated and any help on how I would go about this is also very appreciated.

Thanks,
M
 

Ranman256

Well-known member
Local time
Today, 05:40
Joined
Apr 9, 2015
Messages
4,337
Use 2 queries...
1st, matching query,UPDATE existing records (Only fields you want,keeping notes intact)
The 2nd, add unmatched records.
 

jdraw

Super Moderator
Staff member
Local time
Today, 05:40
Joined
Jan 23, 2006
Messages
15,379
You could use a composite unique index on the combination of fields that make records unique --that will prevent duplicates in future. It ill not remove existing duplicates.

A simple way to remove existing duplicates is to
-copy your table to BkupTable (just in case), then
-copy your current table structure (structure only) to a new table
-manually build your proper Primary key and/or your composite unique index (table design)
-then append your current table data to this new table (append query)
--the PK or unique index will prevent duplicates
-the duplicates will not be copied (duplicate error)
-rename the new table
 

Users who are viewing this thread

Top Bottom