MS Access Time() Function
The Time()
function in MS Access provides a straightforward way to retrieve the current system time.
Time(): Definition and Usage
This function is very useful for recording timestamps in your database, logging events, or performing time-related calculations within your Access applications.
Syntax
The Time()
function doesn't take any arguments. Its syntax is extremely simple:
Syntax
Time()
Parameter Values
The Time()
function has no parameters.
Example
Retrieving the Current Time
In this example, we use Time()
within a query to add the current time to a table's output.
Syntax
SELECT CustomerName, Time() AS CurrentTime
FROM Customers;
Output
This query will return a table with the 'CustomerName' and a new column named 'CurrentTime' containing the current system time for each customer. The exact time will vary depending on when you run the query.
CustomerName | CurrentTime
-------------------------
Customer A | 10:30:45 AM
Customer B | 10:30:45 AM
Customer C | 10:30:45 AM
Technical Details
The Time()
function is available in MS Access starting from version 2000.