On Tue, Jul 10, 2001 at 08:04:55PM +0100, Graham Vickrage wrote:
> 
> The statement I have only selects the count if there is at least 1 order for
> a particular day, which make sense.
> 
> I however need a count of 0 for days that don't have any. Can anyone help?
> 
> SQL:
> 
> SELECT date_part('day', date), count(*)
> FROM client_order WHERE (date >= '01/05/01' AND date < '01/06/01') AND
> status = 'Processing'
> GROUP BY date_part('day', date);

        Didn't look very hard, but can't you just add a: 

CASE WHEN count(*) > 0 THEN count(*) ELSE 0 END AS count

        -Roberto
-- 
+----| http://fslc.usu.edu USU Free Software & GNU/Linux Club |------+
  Roberto Mello - Computer Science, USU - http://www.brasileiro.net 
       http://www.sdl.usu.edu - Space Dynamics Lab, Developer    
HELP! My hard drive crashed & I can't boot up!

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to