473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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
2 2540
ck9663
2,878 Expert 2GB
What's the table structure?

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

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

Similar topics

0
by: lamthierry | last post by:
My python file(progressbar.py) looks like the following: pbar = gtk.ProgressBar() def updateBar(percentage): print percentage pbar.pulse() class ProgressBar: def __init__(self):
7
by: Conax | last post by:
Hello, This is actually a general programming question but I don't know which newsgroup best to put it so please pardon me. I've always been looking for the best way to get an accurate...
3
by: Les Juby | last post by:
I am trying to adjust the window/table size of a website (www.worklaw.co.za) which has made use of DIV tags with its settings embedded in an CSS file. The client wants its width and height to...
22
by: Les Juby | last post by:
I am trying to adjust the window/table size of a website (www.worklaw.co.za) which has made use of DIV tags with its settings embedded in an CSS file. The client wants its width and height to...
9
by: SteFetS | last post by:
Hi, I have a webapplication (asp.net) Snippet: Dim Img As New System.Web.UI.WebControls.Image Img.ID = "Image1" Img.ToolTip = "Trou" Img.ImageUrl = "http://localhost/images/0.bmp"...
0
by: fake ID | last post by:
Since you can't search for these symbols used in asp.net "<%#" or '<%=' I thought i'd post this to make things a little easier to find. Potential search word combinations: -lessthan Percentage...
5
by: James Conrad StJohn Foreman | last post by:
Have found http://www-128.ibm.com/developerworks/db2/library/techarticle/lyle/0110lyle.html which is quite helpful, but doesn't quite tell me what I want. I have a table, advertising_spend with...
10
by: wackyphill | last post by:
After rebuilding an index, it still shows as the same amount of fragmentation. ANy ideas what's wrong? I'm determining which indexes to rebuild using the following query: SELECT...
6
by: Hacking Bear | last post by:
Hi, I still don't quite fully understand how to handle mixing border/margin pixel width with percentage width. In the example below, I want to place side-by-side two DIV boxes inside a box....
0
by: sunny10 | last post by:
Hello, I am new in asp.net and working on my first web application. I am using wizards and want to set its height in percentage let say 100%, but its not working, each wizard step shows different...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.