


The following table identifies the action that occurs as a result of
evaluating expression.
CVDate
| If expression is this type
| CVDate takes this action
|
| A numeric expression between -657434 and 2958465, inclusive
| Considers expression to already be a date serial and makes no change
|
| A numeric expression less than -657434 or greater than 2958465
| Generates a run-time error
|
| A numeric expression that looks like a date, for example, "1 January 1994
12:00 PM"
| Converts expression to a date serial, for example, 34335.5
|
| A numeric expression that looks like a number, for example, "33664"
| Converts expression to a date serial, for example, 33664
|
You can use the
IsDate function to determine whether a string expression can be converted to a date. You should explicitly test numeric expressions to ensure that they fall within the range of acceptable dates.
When converting from a date serial to date format, Access Basic converts any fractional part of the numeric expression to a time of day, starting at midnight.
Example
This example returns a Variant of VarType 7 that contains a Date data type equal to 34370.
X = CVDate( "5 February 1994" )