Description
Returns a whole number representing the year.
Syntax
Year(date)
The date named argument is limited to a date or numbers and strings, in any combination, that can represent a date. If date contains no valid data, Null is returned.
See Also
Date Function, Date Statement, Day Function, Month Function, Now Function, Weekday Function.
Example
This example uses the Year function to obtain the year from a specified date.
' In the development environment, the date literal will display in short ' format using the locale settings of your code. MyDate = #February 12, 1969# ' Assign a date. MyYear = Year(MyDate) ' MyYear contains 1969.