Hi all,
I am trying to select all the records in a table that were input last month, example:
if month today is October select all record with month of September
The query I am using is
SELECT payments.*, members.*
FROM payments, members
WHERE payments.coupon_id = '198C554360'
AND payments.member_id = members.member_id
AND payments.begin_date < NOW() - INTERVAL(1 MONTH)
This display an error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'MONTH)' at line 1
I am not sure if my query is written correctly. Can you advise please.