How to display 0 in a count query if no records?

  • Hello!

    I guess changing a couple of INNER JOINS to LEFT JOINS (or making them subqueries) and removing the WHERE     (dbo.analgroup.sys_analgroup IS NOT NULL) or moving it into a ON clause on a LEFT JOIN clause. Though by doing your INNER JOIN with  dbo.analgroup you also make your where clause unneccessary (since the inner join will eliminat the rows with NULL in the joining field)...

    //Hanslindgren

  • Andrew,

    The basic idea is the list every items of your main table (analgroup) and optionally the records ot other tables by LEFT joining them



    Bye
    Gabor

Viewing 2 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply