Hi,
I got a problem with a query. I'm counting all new registrations in a table and grouping it by the datefield(TO_DAYS(date)). Thats works - but the problem is with days where there are no new registrations. I would like the query to return 0 (zero) for those days - but now it just skips that date, since there is no registrations that day. Is it possible to have the query return 0 for those days?
This is the query I use now:
SELECT
COUNT(id) AS total,
DATE_FORMAT(dato, '%m') AS day
FROM
reg
WHERE
TO_DAYS(date) > (TO_DAYS(NOW()) - 7)
GROUP BY
TO_DAYS(date)