Access: FileDateTime Function
In Access, the FileDateTime function returns the date and time of when a file was created or last modified.
The syntax for the FileDateTime function is:
FileDateTime ( file_path )
file_path is the path to a file name that you wish to retrieve the created or last modified date for.
For example:
FileDateTime ("C:\instructions.doc") would return 6/1/2004 7:40:18 PM FileDateTime ("H:\Documents\Supplies.xls") would return 7/3/2004 3:12:14 PM
VBA Code
The FileDateTime function can be used in VBA code. For example:
Dim LResult As Date
LResult = FileDateTime ("C:\instructions.doc")
In this example, the variable called LResult would now contain the create or last modified date for the instructions.doc file.
SQL/Queries
You can also use the FileDateTime function in a query.
