T-SQL Tutorial

T-SQL YEAR Date Function


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_1Result_2Result_3
201420142014