In Access, the Year function returns an integer between 100 and 9999, inclusive, that represents the year of a date argument.
The syntax for the Year function is:
Year ( date )
The required time argument is any numeric or string expression, that can represent a date. If number is Null, this function returns a Null.
Examples
|
VBA Code
|
This example uses the Year function to obtain the year from a specified date. Now the MyYear variable would contain the value of 1997.
SQL query
You can also use the Year function in a query.
|