hi
i have a column in a table called ContractEnd
it is simply a date in the format 2003-05-21 (usual mysql date format)
im need an SQL statement to find any ContractEnds due in the next month and display the name of the corresponding landlords
the statement i had down is something as follows ...
SELECT LandlordFirstname FROM Landlord, Property WHERE Property.LandlordID = Landlord.LandlordID AND Property.ContractEnd > $date AND Property.ContractEnd < MONTH(DATE_ADD(NOW(), INTERVAL 1 MONTH))
bear in mind that $date is a php variable that is simply
date("Y-m-d");
it doesnt seem to work when i set a value purposely within the range. please correct the sql statement above or give me a better solution.
thanks very much