APPX Software Library

Chapter 4: SQL Language Elements

4.9.2.101 YEAR function (ODBC compatible)

Syntax

YEAR ( date_expression )

Description

The scalar function YEAR returns the year as a short integer value in the range of 0 -9999.

Example

SELECT *
     FROM  orders
     WHERE YEAR (order_date) = 1992 ;

Notes

  • The argument to the function must be of type DATE.
  • The argument must be specified in the format MM/DD/YYYY.
  • The result is of type SHORT.
  • If the argument expression evaluates to null, the result is null.