YEAR()

Documentation

VoltDB Home » Documentation » Using VoltDB

YEAR()

YEAR() — Returns the year as an integer value.

Synopsis

YEAR( timestamp-value )

Description

The YEAR() function returns an integer value representing the year of a TIMESTAMP value. The YEAR() function produces the same result as using the YEAR keyword with the EXTRACT() function.

Examples

The following example uses the DAY(), MONTH(), and YEAR() functions to return a timestamp column as a formatted date string.

SELECT  CAST( MONTH(starttime) AS VARCHAR) || '/' || 
        CAST( DAY(starttime)   AS VARCHAR) || '/' || 
        CAST( YEAR(starttime)  AS VARCHAR), title, description 
        FROM event ORDER BY starttime;