Create query to find certain records based on data in CSV file

estratosphere

New member
Local time
Today, 23:06
Joined
Aug 14, 2014
Messages
4
This may not even be possible, but I am looking to create a Query that can locate records in an Access Table based on 2 columns of data that I have stored in a CSV file.

My table contains several fields, 2 of which are "Dept" and "SKU" and has over a million records.

My CSV file contains 3 fields: "Dept", "SKU" and "Total" - total being the number of times that particular Dept/SKU combination is used.

I need to be able to parse the dept/sku values from each row in the CSV to the query and locate only the records that contain the same values in the Access table.

The plan being to delete out those that are identified by the query.

Any and all help much appreciated.
 
I would import the CSV file into a "Temptable" in the database, then run a delete query and afterwards export the "Temptable" to a CSV file.
 
An alternative would be if it's something you do often and if the CSV file is always in the same location and with the same name then link to the file, create a query to identify and delete where necessary.

Anyway, where are you deleting from?
 
vbaInet,
I have a table already in Access which I wish to delete the matching records from.
 
Ok, but you didn't indicate whether this is something that you will be doing often and if the file will always be in the same location?
 
Apologies...

Yes the file will always be in the same location (on a network drive) and this will happen every week as the data in the CSV is updated
 
Ok, you can still follow the route explained in my first post. Any specific questions, ask us.
 

Users who are viewing this thread

Back
Top Bottom