473,385 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,385 software developers and data experts.

Get a percentage for number of records with a value of 4 or higher

Hi, I have an access table to record my evaluation/feedback data from my teaching at the Museum I work at. I have the table and form set up, but am stumbling on the report.
My boss wants me to report on the percentage of people who answered the overall satisfaction as 4 or 5 (there is a 1-5 option). How do I get the percentage of people/entries who rated it 4 or 5. I have set the form up as a drop down where 1,2,3,4 or 5 can be selected. I almost need an experssion which can work out (number of overall statisfaction entries >3) / (total number of overall satifisfaction entries) * 100
You can tell I'm not a computer tech. I'm not sure if this sould be done in a query or report. Any help/advice would be much appreciated.
Jul 26 '12 #1

✓ answered by john garvey

Hi Anna

Please try this;

In MS Access (whatever version you have) Create a table called 'tblPeople', within that table create two columns(fields) the first data type 'text'; field size '50'; name 'person' make this the primary Key
the second data type 'Number' size 'long'; name 'StatusLevel'
Save the table as tblPeople

Open the table and type in about 10 to 15 names in the person field and scores in the StatusLevel field between 1 and 5.
Open a blank query, close the choose table window without choosing anything, in the top left hand corner of the ribbon (Menu) it should say SQL. Click this and the query will open in SQL mode with 'SELECT;' highlighted. Copy the query below and paste it into the query grid which should delete the 'SELECT;' text that was there previously
Expand|Select|Wrap|Line Numbers
  1. SELECT Count(StatusLevel) AS Total, 
  2. Format(Count(IIf(StatusLevel< 4,0))/Total, "percent") AS LessThanFour, 
  3. Format(Count(IIf(StatusLevel=4,0))/Total , "percent") AS Four, 
  4. Format(Count(IIf(StatusLevel=5,0))/Total , "percent") AS Five 
  5. FROM tblPeople;
To run the query first save it as say 'qryStatus' and then double click it to open and the % data should be there.

Kind regards

7 3017
Hi AnnaNMuseum

Assuming your table is called 'tblPeople', and your result field is called 'StatusLevel' you can extract the percentages with this query. Base your report on a query or queries
Expand|Select|Wrap|Line Numbers
  1. SELECT Count(StatusLevel) AS Total, 
  2. Format(Count(IIf(StatusLevel< 4,0))/Total, "percent") AS LessThanFour, 
  3. Format(Count(IIf(StatusLevel=4,0))/Total , "percent") AS Four, 
  4. Format(Count(IIf(StatusLevel=5,0))/Total , "percent") AS Five 
  5. FROM tblPeople;
Kind regards
Jul 26 '12 #2
Thank you for replying john garvey. I think this might be a bit above my access level ;)
I tried to input the code you supplied in a query as criteria, but it came back at me saying i needed to put parenthesis on the sub query. I'm not sure I even put the code in the right place. But thank you for your help though.
Jul 26 '12 #3
Hi Anna

Please try this;

In MS Access (whatever version you have) Create a table called 'tblPeople', within that table create two columns(fields) the first data type 'text'; field size '50'; name 'person' make this the primary Key
the second data type 'Number' size 'long'; name 'StatusLevel'
Save the table as tblPeople

Open the table and type in about 10 to 15 names in the person field and scores in the StatusLevel field between 1 and 5.
Open a blank query, close the choose table window without choosing anything, in the top left hand corner of the ribbon (Menu) it should say SQL. Click this and the query will open in SQL mode with 'SELECT;' highlighted. Copy the query below and paste it into the query grid which should delete the 'SELECT;' text that was there previously
Expand|Select|Wrap|Line Numbers
  1. SELECT Count(StatusLevel) AS Total, 
  2. Format(Count(IIf(StatusLevel< 4,0))/Total, "percent") AS LessThanFour, 
  3. Format(Count(IIf(StatusLevel=4,0))/Total , "percent") AS Four, 
  4. Format(Count(IIf(StatusLevel=5,0))/Total , "percent") AS Five 
  5. FROM tblPeople;
To run the query first save it as say 'qryStatus' and then double click it to open and the % data should be there.

Kind regards
Jul 26 '12 #4
Hi John, Thank you so much for your clear instructions, I am so close. I did as you instructed, but when I open the query at the last step, a box titled "Enter Parameter Value" pops up and prompts me to to enter a StatusLevel value. When I enter 4 for example it reads all enteries in the table as fours (i ranked all the way from 1-5 in the table)and gives a result that 4 is 100% and the other two catagories scored nothing. Any tips on how to avoid this?
Jul 27 '12 #5
NeoPa
32,556 Expert Mod 16PB
If you'rew getting that prompt Anna, it means you haven't set the table up as instructed.

Your SQL can probably be a little simpler to match the question, but nothing will work as expected unless the table is created according to John's instructions ;-)
Expand|Select|Wrap|Line Numbers
  1. SELECT Count(*) AS [Total]
  2.      , Sum(IIf(StatusLevel>=4,1,0)/Total AS [FourOrMore]
  3. FROM [tblPeople]
Jul 27 '12 #6
Hi Anna

Unzip the attached files and try again, they are access 2007.

Kind regards
Attached Files
File Type: zip percentTest.zip (16.5 KB, 117 views)
Jul 27 '12 #7
John, you are an absolute Star!! I just tried the formula on the original table, just switching out the titles, and it worked perfectly! thank you so much. Just going to do a new post to ask how to run it with the data sorted by month.
Thank you a million
Jul 29 '12 #8

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

Similar topics

1
by: ltamisin | last post by:
Hi Im Leo I want to convert a number to percentage or decimal, is there any built-in function for this? Thanks
1
by: mo | last post by:
I'm using the query desinger in ASP.NET , however the number of records in the resultset are not displaying, so I cut and paste it into Query analyzer which is silly. How do I set this in the...
2
by: Megan | last post by:
Hi everybody- I have 2 tables, Hearings and Rulings. Both have primary keys called, CaseID, that are autonumbers. I don't want both tables to have the same autonumber. For example, if Hearings...
1
by: Ramesh | last post by:
hi, I am selecting fields from three table for manupulating data and i want to display total number of records selected. But i am always getting -1 value, eventhough 1000 of records are selected....
1
by: NewUser | last post by:
I try this: A first "group" query (sorry if this isn't the right name) count the records from a table with a criteria (field1="A") and return counter1=10 records. A second "group" query count the...
17
by: rhitz1218 | last post by:
Hi, I'm trying to create a function that will sort a number's digits from highest to lowest. For example 1000 - will become 0001 or 1234 to 4321
6
by: need some help | last post by:
Hi , Can any body help me here? I have 20 records in file and confidence values for each record like , 0.9, 0.2, 0.3, 0.4 ... and have to use those values in the other program as input....
3
by: Cindy | last post by:
I'm trying to use the NEWID function in dynamic SQL and get an error message Incorrect syntax near the keyword 'ORDER'. Looks like I can't do an insert with an Order by clause. Here's the code:...
4
ollyb303
by: ollyb303 | last post by:
Hello, Trying to help a friend/colleague out with a database and we've both drawn a blank. Not even sure if this is possible. The database has a table (Table1) with a several columns: ID,...
18
kcdoell
by: kcdoell | last post by:
Hello: I have two fields on a table that is displayed on my continous form. GWP = Number Binding Percentage = Text (a value list of 25%, 50%, 90% & 100%) I have a unbound text box that I...
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: 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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.