sql date year code example
Example 1: print year of a date sql
SELECT EXTRACT(YEAR FROM CURRENT_DATE)
Example 2: sql convert datetime to year
select YEAR(getdate())
/* 2020 */
Example 3: year sql server function
YEAR(input_date)
SELECT EXTRACT(YEAR FROM CURRENT_DATE)
select YEAR(getdate())
/* 2020 */
YEAR(input_date)