MSSQLDate/Time FunctionsYEAR
MONTH

YEARDate/Time Functions

DATEFROMPARTS

Returns the year.

Syntax

YEAR(date)

Example

Enter values below to update the example in real time.

hire_date
hire_year
hires
employees
SELECT YEAR(hire_date) AS hire_year, COUNT(*) AS hires
FROM employees GROUP BY YEAR(hire_date);