SELECT based on date value
Posted: Sat Apr 19, 2008 10:51 am
Hi everyone
Im trying to structure a query for my website which selects the users whose membership is nearing expiry and I cant get it to work. Im not sure where im going wrong
Above is the query and that is exactly what queries the database (I copied and pasted from the web page using 'echo' so I could see what was going on server side)
Why does the ADDDATE function work for an INSERT (I have it working for this elsewhere) but not a SELECT ?
Any help is always appreciated
Thanks in advance as always
EC
Im trying to structure a query for my website which selects the users whose membership is nearing expiry and I cant get it to work. Im not sure where im going wrong
Code: Select all
SELECT * FROM Customers WHERE member_level='full' AND expiry_date < ADDDATE(NOW(), INTERVAL 32 DAY)Why does the ADDDATE function work for an INSERT (I have it working for this elsewhere) but not a SELECT ?
Any help is always appreciated
Thanks in advance as always
EC