Quick Ref.
Compatibility
YEAR(d)
Engine OK Alternative
ingres yes EXTRACT(YEAR FROM d)
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: