SQL for last month
I am using the following query to find records for last month
SELECT * FROM application JOIN company JOIN users WHERE YEAR(application.application_date) = YEAR(CURDATE()) AND MONTH(application.application_date) = MONTH(CURDATE())-1 AND application.consultant_company = company.co_id AND application.consultant= users.id ORDER BY application.application_date DESC
However this does not work this month for last month. Any idea why and what I should change the sql too to get it to work?