datevalue(required; Date or literal date)
An Integer from 1 to 31, representing the day of the month
Returns an Integer ranging from 1 to 31, representing the day of the
The range of
datevalue is 1/1/1 to
When working with dates, always check that a date is valid using the IsDate function prior to passing it as a function parameter.
On, you must first convert
datevalue to a Date data type before
passing it to the Day function. You can use the
CDate function for this purpose.
If the day portion of
datevalue is outside
of its valid range, the function regenerates runtime error 13,
“Type mismatch.” This is also true
if the day and month portion of
is 2/29 for a non-leap year.
To return the day of the week, use the WeekDay function.