SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Functions and Expressions
HP NonStop SQL/MX Reference Manual540440-003
9-172
YEAR Function
YEAR Function
The YEAR function converts a DATE or TIMESTAMP expression into an INTEGER
value that represents the year.
YEAR is an SQL/MX extension.
datetime-expression
is an expression that evaluates to a datetime value of type DATE or TIMESTAMP.
See Datetime Value Expressions on page 6-39.
Examples of YEAR
Return an integer that represents the year from the START_DATE column in the
PROJECT table:
SELECT start_date, ship_timestamp, YEAR(start_date)
FROM persnl.project
WHERE projcode = 1000;
Start/Date Time/Shipped (EXPR)
---------- -------------------------- ------
1996-04-10 1996-04-21 08:15:00.000000 1996
YEAR (datetime-expression)