Home page
 
 Home 
 ASP 
 PHP 
 SQL 
 HTML 
 JavaScript 
 Search 
 Contact 
 
Search
or browse popular tags
Access Functions
Subscription

Sign up for the free email newsletter for new tips, tutorials and more. Enter your email address below, and then click the button.

Privacy Policy

RSS Twitter

Access: FileDateTime Function

Print

In Access, the FileDateTime function returns the date and time when a file was created or last modified.

The syntax for the FileDateTime function is:

FileDateTime( pathname )

The required pathname argument is a string expression that specifies a file name. The pathname may include the directory or folder, and the drive.

Example

FileDateTime ("C:\examples.mdb")      returns  25/05/2006 8:18:18 PM
FileDateTime ("H:\Docs\order.xls")    returns 10/10/2000 10:10:10 PM

VBA Code

Dim Result As Date
Result = FileDateTime("C:\examples.mdb")

Now the result variable would contain the create or last modified date for the examples.mdb file. The format of the date and time displayed is based on the locale settings of your system.

SQL query

You can also use the FileDateTime function in a query.

SELECT EmployeeStatisticsTable.EmployeeIDNo,
FileDateTime('C:\Program Files\Outlook Express\msoe.txt') AS Expr1 
FROM EmployeeStatisticsTable

Note:

This function cannot be used in expressions when Access is operating in safe mode.




Tags:

Add To: Add to dzone dzone | Digg this digg | Add to del.icio.us del.icio.us | Stumble it stumbleupon

  • Comments





Copyright © 2005-2014             www.WebCheatSheet.com All Rights Reserved.