Quick Ref.
Functions
date
number
string
Data Types
date
number
string
Compatibility
YEAR(d)
Engine OK Alternative
mysql yes EXTRACT(YEAR FROM d)
oracle no TO_CHAR(d,'YYYY')
postgres no EXTRACT(YEAR FROM (d)
sqlserver yes DATEPART(YEAR,d)

YEAR

YEAR allows you to retrieve the year from a date.

 YEAR(d)

In this example you get the year from the date field whn.


Results
See also: