YEAR function [Date and time]

Function

Returns a 4-digit number corresponding to the year of the given date/time.

Syntax

YEAR ( datetime-expression )

Parameters

datetime-expression A date and time.

Example

The following statement returns the value 1998:

SELECT YEAR( '1998-07-13 06:07:12' ) FROM iq_dummy

Usage

The YEAR function is the same as the first syntax of the YEARS function.

Standards and compatibility

See also

“YEARS function [Date and time]”