Jump to content

Count() to show all records


inbowns

Recommended Posts

I was able to get my count to work that I posted in my previous post but I have a problem I would like the post to count everything but if there's a that is Yes in my column but if there all No I would also like it to display 0 in the same output something like this.

 

Type                        Response = Yes

Car                                5                 

Truck                              1

Bike                                0

Walk                              3

Swim                              0

Flying                              1

 

 

So the "0" should show that the database saw "No" and displayed a zero.

Link to comment
Share on other sites

You need SUM and IF:

 

SUM( IF(expr,1,0) )

 

I guess this will work but i also need it to show if there's for example 3 "no" then the data it should return a zero but currently it doesn't show anything. Essentially i want a count of the "Yes" if there 10 "yes" i want that actual count and if there's a "No" it should give me a zero regardless of how many there are listed.

 

I hope this is clear

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.