bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL YEAR() Function

Example

SELECT YEAR("2017-06-15");

Definition and Usage

The YEAR() function returns the year part for a given date (a number from 1000 to 9999).

Syntax

YEAR(
date
)

Parameter Values

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

Technical Details

Works in:From MySQL 4.0

Previous

MySQL WEEKOFYEAR() Function

Next

MySQL YEARWEEK() Function