Create query to find certain records based on data in CSV file (1 Viewer)

estratosphere

New member
Local time
Today, 08:47
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.
 

JHB

Have been here a while
Local time
Today, 09:47
Joined
Jun 17, 2012
Messages
7,732
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.
 

vbaInet

AWF VIP
Local time
Today, 08:47
Joined
Jan 22, 2010
Messages
26,374
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?
 

estratosphere

New member
Local time
Today, 08:47
Joined
Aug 14, 2014
Messages
4
vbaInet,
I have a table already in Access which I wish to delete the matching records from.
 

vbaInet

AWF VIP
Local time
Today, 08:47
Joined
Jan 22, 2010
Messages
26,374
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?
 

estratosphere

New member
Local time
Today, 08:47
Joined
Aug 14, 2014
Messages
4
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
 

vbaInet

AWF VIP
Local time
Today, 08:47
Joined
Jan 22, 2010
Messages
26,374
Ok, you can still follow the route explained in my first post. Any specific questions, ask us.
 

Users who are viewing this thread

Top Bottom