MS Access Now() Function
The Now()
function in MS Access retrieves the current date and time from the computer's system clock. It's a simple yet very useful function for recording timestamps, tracking events, or performing time-related calculations within your Access database.
Now(): Definition and Usage
Now()
is frequently used to add a timestamp to database records, create logs of activities, or calculate durations between events. The exact format of the date and time will depend on your system's regional settings.
Syntax
The Now()
function is very straightforward; it doesn't take any arguments:
Syntax
Now()
Parameter Values
The Now()
function doesn't require any parameters.
Example
Retrieving the Current Date and Time
This example shows how to use Now()
in a query to display the current date and time alongside customer names from a 'Customers' table (assuming a table named 'Customers' with a 'CustomerName' column exists).
Syntax
SELECT CustomerName, Now() AS CurrentDateTime
FROM Customers;
Output
CustomerName | CurrentDateTime
--------------------------------
(Customer names) | (Current date and time - will vary)