SELECT EXTRACT(YEAR FROM '2018-07-22') Code language: SQL (Structured Query Language) (sql)
SELECT YEAR(DateTimeField) FROM MyTable
SELECT FORMAT(<your-date-field>,"YYYY-MM") AS year-date FROM <your-table>