bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL Server YEAR() Function

Example

SELECT YEAR('2017/08/25') AS Year;

Definition and Usage

The YEAR() function returns the year part for a specified date.

Syntax

YEAR(
date
)

Parameter Values

ParameterDescription
dateRequired. The date or datetime to extract the year from

Technical Details

Return type:int
Works in:SQL Server (starting with 2008), Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse

Previous

SQL Server SYSDATETIME() Function

Next

SQL Server CAST() Function