sql get year code example
Example 1: get current year sql
select year(getdate())
Example 2: print year of a date sql
SELECT EXTRACT(YEAR FROM CURRENT_DATE)
Example 3: sql get year from datetime field
SELECT YEAR(DateTimeField)
FROM MyTable
select year(getdate())
SELECT EXTRACT(YEAR FROM CURRENT_DATE)
SELECT YEAR(DateTimeField)
FROM MyTable