YEAR (TSQL Function)

Returns the year of the specified date.

Syntax

YEAR ( date )

Arguments

date
is an expression of type date or datetime.

Return Types

Returns int.

Examples

PRINT YEAR('2016-10-04');

The result is:

2016
RSQL, a simple alternative to Microsoft SQL Server