YEAR
Description
Returns an integer that represents the year of the specified date. (YEAR in Transact-SQL).
Sample Source Pattern
Syntax
YEAR( date ) YEAR ( <date_or_timestamp_expr> )Examples
Code:
SELECT YEAR('10-10-2022') AS YEARResult:
YEAR |
-----+
2022 |Code:
SELECT YEAR('10-10-2022' :: TIMESTAMP) AS YEAR;Result:
YEAR |
-----+
2022 |Last updated