List:General Discussion« Previous MessageNext Message »
From:Paul Halliday Date:February 3 2006 3:52pm
Subject:problem with excluded days in date range query.
View as plain text  
I have the following query:

select count(*) as cnt, date(timestamp) as day from table where
date_sub(curdate(),interval 14 day) <= timestamp group by day;

If there are no data for a particular day, it is not included. Is
there a way to include all days even if the result is 0? I saw an
example that included another table with all dates and an inner join
but that seems a little clunky.

Thanks.
Thread
problem with excluded days in date range query.Paul Halliday3 Feb
  • Re: problem with excluded days in date range query.sheeri kritzer3 Feb
  • Re: problem with excluded days in date range query.Peter Brawley3 Feb