Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old October 3rd, 2008, 07:37 PM
Newbie
 
Join Date: Oct 2008
Posts: 1
Default Working out a percentage using sql

I have a table that holds four questions and the values assigned to that question. The value can only be Yes or No.

The results will look something like this Q1) Y, Q2) N, Q3) Y, Q4) Y. How can I get my sql result to display 75%?

At the moment I can only get the count to say 3 Yes and 1 No.

Thank you in advance
Reply
  #2  
Old October 3rd, 2008, 07:40 PM
ck9663's Avatar
Expert
 
Join Date: Jun 2007
Posts: 1,512
Default

What's the table structure?

-- CK
Reply
  #3  
Old October 4th, 2008, 12:28 AM
joedeene's Avatar
Site Addict
 
Join Date: Jul 2008
Location: US of A
Posts: 587
Default

Quote:
Originally Posted by tonyshort
I have a table that holds four questions and the values assigned to that question. The value can only be Yes or No.

The results will look something like this Q1) Y, Q2) N, Q3) Y, Q4) Y. How can I get my sql result to display 75%?

At the moment I can only get the count to say 3 Yes and 1 No.

Thank you in advance
would simple math not work, how is the "3 Yes and 1 No" returned, if you can add the Y's and N's then do something like divide the returned Y's by the total(Y+N) ? because 3/4 would give you .75, 75%...

joedeene
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles