MySQL Forums :: Newbie :: Queries to limit only this month and next month


Advanced Search

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 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

Options: ReplyQuote


Subject Written By Posted
Queries to limit only this month and next month Dodong Fortaliza 09/14/2010 08:58AM
Re: Queries to limit only this month and next month Guelphdad Lake 09/14/2010 11:33AM
Re: Queries to limit only this month and next month Dodong Fortaliza 09/14/2010 02:15PM
Re: Queries to limit only this month and next month Rick James 09/14/2010 09:43PM
Re: Queries to limit only this month and next month Dodong Fortaliza 09/15/2010 05:12PM
Re: Queries to limit only this month and next month nuesha moore 09/17/2010 08:31AM


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.