SQL Flow Field Guide

YEAR

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

date/time arithmetic, parts, construction or truncation

What changes

Input
date/time arguments
Output or change
date/time or integer value
Return type
int

Syntax at a glance

YEAR ( date )

Work example

Read the year part for display or a small result set.

For large date filters, prefer a range on the raw column so an index can serve the predicate.

Check your work YEAR returns an integer and treats a time-only input as a date in 1900.

Practice SQL

Open in SQL Flow
SELECT YEAR(CONVERT(date, '2026-04-05')) AS calendar_year;

Open Microsoft Learn for full syntax, permissions, and details for your version.