Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2006

    Unanswered: Querying Multiple Counts

    Can someone assist?
    (see screen shot of what is needed)
    I set up the Owner Rep so that users enter the release ID (i.e. R15) relative to the counts, which I would also like to show in the same query. Counts I would like to include: Total Release IDs (after user input), Status = Resolved, and Status = <> Resolved.

    Any help would be greatly appreciated.
    I can do each of these individually, but seem to run into problems when trying to get multiple counts within one query, based on the Release input via user.

    Attached Thumbnails Attached Thumbnails 1a.PNG  

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    all those counts will be the same, assuming there aren't any NULL values in the columns

    please switch to the query's SQL view and paste it here | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    May 2007
    I am certainly no expert, but I have had similar issues before, but find that I can do multiple counts like that in the same query by using an expression form. For instance,

    SIB Total: Sum(([SIB]=-1)*-1)
    SIBNoBSP: Sum(([HasBSP]=0 And ([SIB]<=-1))*-1)

    These are individual codes from my query. The -1 was just done so I could get a nice positive number. These codes are counting check boxes in case you wonder, but I am sure you get the point. Don't try and use the count function to count all those different variables, use an expression and an alias.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts