I have dates stored in mysql database in date format 0000-00-00. I cant figure out how to select records where the date stored is 30 days or less ahead of today?
SELECT * FROM tablename
WHERE date_field <= DATE_ADD(NOW(), INTERVAL 30 DAY)
AND date_field > NOW();
Great works ..
I was tring the likes of
SELECT * FROM calendar WHERE starttime BETWEEN NOW() AND DATE_ADD(NOW(), INTERVAL 6 HOUR) AND sendemail = 1
But wouldnt work?
I thought it was correct