I am working on Access 2012 on win 7. In a table, I need to change a year date format from '1-Jan-06' to 2006 and from '1-Jan-90' to 1990. I only need year.
This is my query
SELECT *,
CASE
WHEN CAST(right(year_date,2) , INT) <= 12
THEN 2000 + CAST(right(year_date,2) , INT)
ELSE 1900 + CAST(right(year_date,2) , INT)
END
FROM my_table;
I got error:
syntax error (missing operator) in the query expression of 'CASE -- END'.