Forum Moderators: coopster
I've been using: 'select count(id), dayofyear(created_on) from users group by dayofyear(created_on) ' and its been working fine. The problem is that there are certain days when no users register; currently, no row is returned, but what I really need is for a row of '0' to be returned with the appropriate dayofyear. I need this '0' datapoint for the purposes of graphing. Without it, the graph isn't scaled correctly.
The current fix is abstracting out of mysql and using php to loop through the data, make sure it is consecutive, insert 0 and day when it isnt, etc., but I'd like to have this all be part of the sql if possible.
Can anyone see a way to do this?
Appreciate it,
will
Of cource you can name them in an alternate way, for example jan01, jan02, etc.
Your script, your choise :)