Duplicated Data

jamesjohnturner

New member
Local time
Today, 11:04
Joined
Aug 6, 2014
Messages
2
I have a table where csv files get imported to on a daily basis. The key fields I am working with are a supply number and date. The problem I have is that sometimes the csv file will contain information that is correcting/updating information held in the table. This is creating duplicated records.

I need to either create a query to find records that have the same supply number and date or find a way of overwriting the records in the table with the new data.

I hope I have explained myself clearly, but any suggestions will be much appreciated.
 
You would need to bring your new data into a temporary table (TMP) and not directly into the main table (MAIN). Then to move your data in the appropriate manner you would need 2 queries:

1. Would use an INNER JOIN between TMP and MAIN. This query will provide the records that need to be updated.

2. Would use a LEFT JOIN from TMP to MAIN and would exclude any non null values in MAIN. This query will provide the records that need to be added.
 
So will the LEFT JOIN overwrite old data that has the same date?
 

Users who are viewing this thread

Back
Top Bottom