I know this has prob been answered, but I've searched for almost an hour now and Im not finding my answer.
Here is my sql query.
SELECT *
FROM (`calenda开发者_开发百科r_event`)
WHERE DATE_FORMAT(`start_time`, '%m/%d/%Y')
BETWEEN CURDATE() + INTERVAL 5 DAY AND CURDATE()
Here is the format of the start_time
column 06/30/2011 8:30 AM
The query isn't having any errors, Im just not getting any results...
BETWEEN a AND b
needs b
to be greater than a
, otherwise the interval is empty.
Try inverting the two date parameters you're building.
Try this: WHERE date_col BETWEEN 'date1' and 'date2'
精彩评论