In Access, the DateValue function returns the date represented by the date of a String argument.
The syntax for the DateValue function is:
DateValue ( string )
The argument string is a String representing a date from January 1, 100 through December 31, 9999. It can include a time component, if desired. If string includes only numbers, DateValue recognizes the order for month, day, and year according to the Date Format setting in the International section of the Microsoft Windows Control Panel. If the year part of string is omitted, DateValue uses the current year from your computer’s system date. If string includes time information, DateValue does not return it.
Examples
|
VBA Code
|
This example uses the DateValue function to convert a string to a date. Now the MyDate variable would contain the value of 10/10/2005.
SQL query
You can also use the DateValue function in a query.
|