Year() Function in MS Access

Year() : Function in Microsoft Access is used to return the year part of a given date.

Syntax :

Year (date)

Parameter : This method accepts one parameter as mentioned above and described below :

  • date : It is any variant, numeric expression, string expression, or any combination of these that can represent a date.

Returns : It Returns the year part of a specified date . If date contains Null, Null is returned.

Example-1 : Find Year from a specified Date :



SELECT Year(#05/17/2017#);

Output :

2017 

Example-2 : Find Year part of Today :

SELECT Year(Date());

Output :

2020

Example-3 : Find Year of Joining of the Employee :

SELECT Year(JoiningDate) FROM Employees;

Output :

1990
2004
1992

Note : There Should be JoiningDate column in Employees Database.Here, the Employees Database contains only 3 records.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.