Argument | Description |
string | A string containing a valid date (such as "Jan 1, 1998", or "12-31-99") that you want returned as a date |
The value of the string must be a valid date.
Valid dates can include any combination of day (1-31), month (1-12 or the name or abbreviation of a month), and year (two or four digits). Leading zeros are optional for month and day. If the month is a name or an abbreviation, it can come before or after the day; if it is a number, it must be in the month location specified in the Windows control panel. A 4-digit number is assumed to be a year.
An expression has a more limited set of data types than the functions that can be part of the expression.
Although the Date function returns a date value, the whole expression is promoted to a DateTime value. Therefore, if your expression consists of a single Date function, it will appear that Date returns the wrong data type.