Last updated 1 year ago
Returns an integer that represents the year of the specified date. (YEAR in Transact-SQL).
YEAR( date )
Snowflake SQL Documentation
YEAR ( <date_or_timestamp_expr> )
Code:
SELECT YEAR('10-10-2022') AS YEAR
Result:
YEAR | -----+ 2022 |
SELECT YEAR('10-10-2022' :: TIMESTAMP) AS YEAR;