I have a query that groups all entries from a table and groups them by the datetime column. This is all working great:
SELECT SUM( `value` ) AS `sum` , DATE(`datetime`) AS `dt``
FROM `entry`
WHERE entryid = 85
AND DATETIME BETWEEN '2010-01-01' AND '2010-03-01'
GROUP BY `dt`
ORDER BY `datetime`
The problem is, I need it to return a row even if nothing is found, with the value set to 0. I assume there's some MYSQL function that'll take care of this but can't seem to find it.
Thanks!