I'm currently trying to use this query
SELECT
a.id AS id,
a.item AS item,
c.id AS campaign_id,
DATE(c.start_date) AS START,
DATE(c.end_date) AS END
FROM campaign c LEFT JOIN action_6 a
ON c.id = a.campaign_id WHERE action_id = 6
AND TIMESTAMP('2010-08-24 11:59:59') BETWEEN c.start_date AND c.end_date;
however i am getting an empty resultset due to the AND '2010-08-24 11:59:59' BETWEEN c.start_date AND c.end_date
.
c.start_date
and c.end_date
(on the desired row) are 2010-08-23 00:00:00
and 2010-07-29 23:59:59
so it should be returning the row yes?
Edit: updated query to show explicit conversion.