SQL Server YEAR() Function
Definition and Usage
The YEAR() function returns the year (as a four-digit number) for a given date.
Syntax
YEAR(date)
Parameter Values
Parameter | Description |
---|---|
date | Required. The date to return the year from |
Technical Details
Works in: | SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, SQL Server 2005 |
---|
More Examples
Example
Return the year for a given date:
SELECT YEAR('1998/05/25 09:08') AS Year;
Try it Yourself »