This MSAccess tutorial explains how to use the Access DateValue function with syntax and examples.
The Microsoft Access DateValue function converts a string to a date.
The syntax for the DateValue function in MS Access is:
DateValue ( string_date )
The DateValue function can be used in the following versions of Microsoft Access:
Let's look at how to use the DateValue function in MS Access:
DateValue ("June 30, 2004") Result: 6/30/2004 DateValue ("6/30/2004") Result: 6/30/2004 DateValue ("June 30") Result: 6/30/2004
The DateValue function can be used in VBA code in Microsoft Access.
Dim LDate As Date LDate = DateValue ("May 15, 2003")
In this example, the variable called LDate would now contain the value of 5/15/2003.
You can also use the DateValue function in a query in Microsoft Access.
In this query, we have used the DateValue function as follows:
Expr1: DateValue('February 3, 2002')
This query will take a string representation of "February 3, 2002" and return its date value in a column called Expr1. You can replace Expr1 with a column name that is more meaningful.
NewDate: DateValue('February 3, 2002')
The results would now be displayed in a column called NewDate.
(scroll to see more)