467,915 Members | 1,301 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,915 developers. It's quick & easy.

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
Oct 3 '08 #1
  • viewed: 2354
Share:
2 Replies
ck9663
Expert 2GB
What's the table structure?

-- CK
Oct 3 '08 #2
joedeene
512MB
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
Oct 3 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by lamthierry | last post: by
7 posts views Thread by Conax | last post: by
3 posts views Thread by Les Juby | last post: by
22 posts views Thread by Les Juby | last post: by
9 posts views Thread by SteFetS | last post: by
5 posts views Thread by James Conrad StJohn Foreman | last post: by
10 posts views Thread by wackyphill | last post: by
6 posts views Thread by Hacking Bear | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.