Table modify date not changing after exporting data into another database tbl

gdesreu

Active Member
Joined
Jul 30, 2012
Messages
318
Hi,

I have some VBA that dumps data from one database into another database into a specific table, however after it dumps the data, the modify date on the table I am dumping it to does not update. Is there a way to trigger this date modified if you are dumping in the data from another database? This date is extremely important for tracking purposes.
Thanks
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
I would probably go about this a different way.
I would add a new field to your table, something like "AddedDate". Then your process which dumps the data into the table, have it update this field to the current date/time. Then you will not only be able to know when the table was last modified, but when each record was actually added.

And you could use a simple Aggregate Query to get the date of the last update, i.e.
Code:
SELECT Max(DateAdded) AS LatestAddedDate
FROM MyTable;
 
Upvote 0
I would probably go about this a different way.
I would add a new field to your table, something like "AddedDate". Then your process which dumps the data into the table, have it update this field to the current date/time. Then you will not only be able to know when the table was last modified, but when each record was actually added.

And you could use a simple Aggregate Query to get the date of the last update, i.e.
Code:
SELECT Max(DateAdded) AS LatestAddedDate
FROM MyTable;
Thanks this was my backup plan, but the issue is many of our DB users look at the modified date for reference in our systems to ensure they have the right version of the data so I was hoping to figure out how to trigger the modified date as if it were a local table. Otherwise I will have to tear apart a lot of export functions.
 
Upvote 0
Note that if you are talking about the Modified date on the table, that refers to the Table structure, not the Table data.
Updating data in that table, regardless of how it was done (import, manually, update query, etc) will NOT affect that date.
Only changing the Table structure/design will update that date.

So if you are trying to capture when data was last added to the table, you do NOT want to use this date (you are using the wrong field for the job!).

You can see this pretty easily. Check the Modified date on the table. Now add a data record to that table manually. Now go back and check the Modified date. You will see it has not changed.
 
Last edited:
Upvote 0
Note that if you are talking about the Modified date on the table, that refers to the Table structure, not the Table data.
Updating data in that table, regardless of how it was done (import, manually, update query, etc) will NOT affect that date.
Only changing the Table structure/design will update that date.

So if you are trying to capture when data was last added to the table, you do NOT want to use this date (you are using the wrong field for the job!).

You can see this pretty easily. Check the Modified date on the table. Now add a data record to that table manually. Now go back and check the Modified date. You will see it has not changed.

Thanks a lot that is good to know!!!
 
Upvote 0

Forum statistics

Threads
1,215,040
Messages
6,122,806
Members
449,095
Latest member
m_smith_solihull

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