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