MySQL Forums
Forum List  »  Newbie

Queries to limit only this month and next month
Posted by: Dodong Fortaliza
Date: September 14, 2010 08:58AM

Hi Guys,

I have this SQL statement:

SELECT, 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_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?


Options: ReplyQuote

Written By
Queries to limit only this month and next month
September 14, 2010 08:58AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.