I have table called TrainingMatrix and it has a column called ExpiryDate. I am trying to write an SQL statement which can show me all records of 2012 as following:
SELECT * FROM "TrainingMatrix" WHERE "ExpiryDate" - current_date < 0 AND EXTRACT(YEAR FROM TIMESTAMP "ExpiryDate") = 2012;
But this doesn't work, can any one help?
I am using PostgreSQL.