Queries to limit only this month and next month
Hi Guys,
I have this SQL statement:
SELECT contacts.id, salutation, first_name, last_name, contacts_cstm.id_c, customerstatus_c, DATE_FORMAT(STR_TO_DATE(expirydate_c, "%d/%m/%Y"), "%M %d, %Y") as expiration_date
FROM contacts, contacts_cstm
WHERE contacts.id = contacts_cstm.id_c
AND contacts_cstm.customerstatus_c = "Paying Customer"
ORDER BY contacts.first_name
The expirydate_c is varchar type and that is why I used DATE_FORMAT and STR_TO_DATE function to convert that type to datetime format.
My problem here, is to limit only my query to display expiration with this MONTH and next MONTH.
How I am going to do this?
Thanks