creating % query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, I am very new to Access and database in general. I have a database that has 3 columns that are each peoples' names and every time someone submits a vot for a person a value of "1" gets submitted to their column. I created a query that gave the sum of votes for each contestant and then tallied the total number of votes. But what I want to do now is create a query that would give the percentage of votes each contestant has recieved. thanks for any help Matt
 
Can a person vote for more than one contestant? Could you type in about 10
records and the end result you would like to display?

--
Duane Hookom
MS Access MVP


Matthew said:
Hello, I am very new to Access and database in general. I have a database
that has 3 columns that are each peoples' names and every time someone
submits a vot for a person a value of "1" gets submitted to their column. I
created a query that gave the sum of votes for each contestant and then
tallied the total number of votes. But what I want to do now is create a
query that would give the percentage of votes each contestant has recieved.
thanks for any help Matt
 
No they can only vote for one contestant at a time. My table looks like this Staci Erin Meliss
0 0
0 0 1
0 0
1 0
0 1
0 1 0
0 0
0 0 1
0 1
0 0 1
So for this example there are a total of 10 votes, so for Staci I would like to display 10% ; Erin 30% ; Melissa 60%. I tried to do a query where it added each columns numbers up and then divided by the total of all the columns but I could not get it to work I am not that familiar with access. Thanks for any of you help. Matthew
 
SELECT Sum([Staci]) as StaciVotes, Sum([Erin]) as ErinVotes, Sum([Melissa])
as MelissaVotes, Sum([Staci])/Count(*) as StaciPct, Sum([Erin])/Count(*) as
ErinPct, Sum([Melissa])/Count(*) as MelissaPct
FROM tblVotes

--
Duane Hookom
MS Access MVP


Matthew said:
No they can only vote for one contestant at a time. My table looks like
this
Staci Erin Melissa
0 0 1
0 0 1
0 0 1
1 0 0
0 1 0
0 1 0
0 0 1
0 0 1
0 1 0
0 0 1
So for this example there are a total of 10 votes, so for Staci I would
like to display 10% ; Erin 30% ; Melissa 60%. I tried to do a query where it
added each columns numbers up and then divided by the total of all the
columns but I could not get it to work I am not that familiar with access.
Thanks for any of you help. Matthew
 
Back
Top