
How to Use the YEAR() Function in SQL Server: A Complete Guide
☰Fullscreen
Syntax:
Year()
Returns the 'Year number' of the given date.
Code:
Select Year(GETDATE())
Returns the year number, based on the current system date.
Select Year('01/31/2019')
Output:
The above code will produce the following result-
2019
No Questions Data Available.
No Program Data.