The T-SQL YEAR function is an date function and returns an integer that represents the year of the specified date.
YEAR Syntax:
YEAR (date)
YEAR Example:
SELECT YEAR('2014-03-01') as Result_1,
YEAR('2014-03-01 17:01:25.1234567 +07:10') as Result_2,
YEAR(SYSDATETIME()) as Result_3;
Result_1 | Result_2 | Result_3 |
---|---|---|
2014 | 2014 | 2014 |