Skip to content

YEAR

  • date: Represents the date value from which the year part is to be extracted. This can be a date type or can be a string formatted in various date-compatible formats.
SELECT YEAR('2021-07-01');
2021

The YEAR function in SQL extracts the year from a date. In the above example, 2021 is extracted from the date ‘2021-07-01’.