YEAR: Obtaining the Year From a Date or Timestamp

How to:

The YEAR function returns the year field from a date or timestamp value.


Top of page

x
Syntax: How to Obtain the Year From a Date or Timestamp
YEAR(arg)

where:

arg

Date or timestamp

Is the input value.

This function returns an integer value.



Example: Obtaining the Year From a Date or Timestamp

YEAR returns the year from a date or timestamp value. This example,

YEAR('1976-07-04')

returns 1976.

This example,

YEAR('2001-01-22 10:00:00')

returns 2001.


iWay Software