check dates

Sully38

Board Regular
Joined
Mar 9, 2004
Messages
167
I am working in Access 2002

I have 3 .csv files that are coming in monthly, The task I am attempting to complete is to build a routine that will massage the data(Which I have already completed) The massaged data than need to get loaded into a large collection table.

Here is where I run into trouble on something I thought would be simplest aspect. The massaged data has a processed date on each record, All I need to do is check the Big File if that date exist let the massaged data write over the previous data.

My thought was to generate a maxdate query on the massaged data and run a delete query based on the large file with a criteria statement pointing to the max date:

DELETE [Big File].*, [Big File].FileDate
FROM [Big File], Query1
WHERE ((([Big File].FileDate)=[query1]![Maxoffiledate]));

Is there a better way than what I am trying to do ?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Maybe you could try building a simple query from the BigFile table to the Collection table, using the processed date as the join key -- unless I'm missing something, I don't see the reason for the MaxDate bit. Any matching records in BigFile can then be deleted.

Denis
 
Upvote 0
It looks more like you want to use an update query to modify your existing data to match your new data.

HTH

Peter
 
Upvote 0

Forum statistics

Threads
1,221,714
Messages
6,161,467
Members
451,708
Latest member
PedroMoss2268

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