MS Access: Now Function
This MSAccess tutorial explains how to use the Access Now function with syntax and examples.
Description
The Microsoft Access Now function returns the current system date and time.
Syntax
The syntax for the Now function in MS Access is:
Now ()
Parameters or Arguments
There are no parameters or arguments for the Now function.
Returns
The Now function returns a date value.
Applies To
The Now function can be used in the following versions of Microsoft Access:
- Access 2019, Access 2016, Access 2013, Access 2010, Access 2007, Access 2003, Access XP, Access 2000
Example
Let's look at how to use the Now function in MS Access:
Now() Result: '22/11/2003 10:42:58 PM' (your answer will differ)
Example in VBA Code
The Now function can be used in VBA code in Microsoft Access.
For example:
Dim LValue As String LValue = Now
In this example, the variable called LValue would now contain the current system date and time.
Example in SQL/Queries
You can also use the Now function in a query in Microsoft Access.
For example:
In this query, we have used the Now function as follows:
Expr1: Now()
This query will return the current system date and time. The results will be displayed in a column called Expr1. You can replace Expr1 with a column name that is more meaningful.
For example:
CurrentDateTime: Now()
The results would now be displayed in a column called CurrentDateTime.
Advertisements