SELECT *
FROM `summary`
WHERE submit_date = curdate()
AND submit_date > '06:00'
AND submit_date < '21:00'
LIMIT 0 , 30
This is pulling all dates including today? submit_date is a column that shows has DATETIME and it’s not filtering them out like they should be. What am I missing? Thanks!
Your 2 limiting conditions should be comparing against the value returned by
TIME()if it is aDATETIMEcolumn, and the first condition should be limited to theDATE()portion only.