getdate year sql code example
Example 1: get current year sql
select year(getdate())
Example 2: sql get year from datetime field
SELECT YEAR(DateTimeField)
FROM MyTable
select year(getdate())
SELECT YEAR(DateTimeField)
FROM MyTable