Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get date from table modified date

Status
Not open for further replies.

BrotherOmar

Technical User
Feb 2, 2006
42
US
I want to include in a report a field titled "data valid as of [date]". I want the date to equal the date a table was last modified. I'm guessing i'll have to create some code that 1) goes and looks at table property date modified and 2) formats this date for the report.

Anyone know a way to do this?

Thanks,

Omar

----
Tell 'em Omar back!
 
The MSysObjects table (which is hidden by default, so you might not see it) can be queried.

You need to note the following fields:

Name - obvoiuosly stores the name of your table
Type - type of db object. 5 for tables.
DateUpdate - this may or may not give you the modified date for your table.

Try a simple query like this as an example:

SELECT DateUpdate FROM MSysObjects WHERE Name='TableNameHere' AND Type=5;

[pc2]
 
The DateUpdate field stores the last design change.
 
Omar, do you want the date a table was last changed or the date data in that table was last changed? As pHV points out, my post will give you the former only, which seems to be what you were asking but who knows?

If you need the latter, you need to create a DateTime field in your table and populate/update it each time a record is updated, then you can query that.

[pc2]
 
I need the later, so I guess I'll just have to create an update query or modify data imports to include a date field set to the date of importation.

Thanks for the help.



----
Tell 'em Omar back!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top