I'd like to use CURDATE so that I can show content + 7 days ahead of the actual date. Something like this? (but of course this won't work): ORDER BY a.date_live > CURDATE(7) Code (markup): I think there's a where statement to be added someplace too? thanks guys
Use WHERE a.date_live > DATE_ADD(CURDATE() INTERVAL 7 DAY) ORDER BY a.date_live Code (markup): Not tested, but should work
I thought DATE_ADD choked on anything that wasn't a full ISO date, which is why you'd use NOW() instead of CURDATE()... Other than that, yeah. Use DATE_ADD with INTERVAL... though you also missed a comma. WHERE a.date_live > DATE_ADD(NOW(), INTERVAL 7 DAY) ORDER BY a.date_live Code (markup):
Those are some great answers.. not tested this yet, not sure if this is a good tip but you could maybe use DATE_SUB(NOW(), INTERVAL 7 DAY) Code (markup): the system needs show events to happen 7 days ahead. WHERE date_starts >= DATE_ADD(NOW(), INTERVAL 7 DAY) ORDER BY date_starts Code (markup):