Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Reference » SQL Functions » Alphabetical list of functions

XMLGEN function [String] Next Page

YEAR function [Date and time]

Takes a timestamp value as a parameter and returns the year specified by that timestamp.


YEAR( datetime-expression )


datetime-expression    A date, time, or timestamp.


The value is returned as a short value.

Standards and compatibility

The following example returns the value 2001.

SELECT YEAR( '2001-09-12' );