473,387 Members | 1,517 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,387 software developers and data experts.

How do I count YES in a field and then get percentage of total yes

field H&P done w/in 24 hours yes or no I have 5 total records audited 4 have yes answers and 1 does not. in excel I count if range =yes and then I divide my number of yes by the total numbers of records to get my percentage how do I build this in my query in access?
Oct 13 '15 #1
7 1373
NeoPa
32,556 Expert Mod 16PB
If you make it a GROUP BY query (Press the Sigma button when designing the query) then you can use the aggregation function Count() to determine how many records are returned (Total number) and the aggregate function Sum() with an IIf() to select the Yeses. The percentage can be worked out by dividing one by the other.
Oct 14 '15 #2
hvsummer
215 128KB
did you try to use this way ?
set a field to count (sum actually, but not sum in group query)
let insert this into expression
"CountABC: iif(H&PDoneW/in24H = true, 1, 0)"
this field will return 1 and 0 for you to sum, sum of the will be exactly number of yes, but you don't need group query to know how much.

you can open that query in datasheet view then go to Home -> Records sub ribbon -> Totals -> click on that totals
then choose sum in the CountABC field (still in datasheet view).
Oct 14 '15 #3
NeoPa
32,556 Expert Mod 16PB
HVSummer:
but you don't need group query to know how much.

you can open that query in datasheet view then go to Home -> Records sub ribbon -> Totals -> click on that totals
You really should check what you say before posting it. Otherwise you give out mis-information that can confuse people and waste other experts' time having to contradict you publicly, which is usually to be avoided, but is necessary when you post stuff that's factually wrong. It wasn't necessary when you did it to me as my post was actually 100% correct.

In this case, you clearly do need a GROUP BY query, just as I said in my earlier post. When you click on the Totals button on the ribbon that's exactly what you're doing - converting it into a GROUP BY query.

Again, please be very careful before posting, that you know what you're talking about to save time correcting you, and to save what must be humiliation when you're shown to be posting wrong information.
Oct 16 '15 #4
hvsummer
215 128KB
I think something missunderstand here, the total in ribbon doesnt convert select query into group by query... I said the total in datasheet view, not design view, plz read carefully.

you can see it in this link, the #2 function
http://www.fmsinc.com/microsoftacces...-features.html.
Oct 16 '15 #5
NeoPa
32,556 Expert Mod 16PB
I apologise.

It turns out that you were/are right and I was mistaken.

I will happily remove these posts if you agree to that (Just the discussion part).
Oct 16 '15 #6
hvsummer
215 128KB
no, Mate, we help eachother, and sometime our communication like this ---"critical error -- VBA on fire because JET engine can't transfer message" lol.
btw I'm happy to wait Jshoppel reply his situation after read our suggestions.
Oct 16 '15 #7
NeoPa
32,556 Expert Mod 16PB
HVSummer:
"critical error -- VBA on fire because JET engine can't transfer message"
I like that :-D

TBF, on this occasion, though I struggled to understand what you were saying, I was guilty of hypocrisy (& I can't begin to express how unhappy I am about that.) by not checking more carefully before making my comments public. While I regret that, I appreciate your attitude. Good on yer.

PS. we can't always rely on the OP ever coming back to comment, as many never do. I'm happy that your post was good advice regardless of whether they do or not.
Oct 16 '15 #8

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

Similar topics

2
by: Phil Kershaw | last post by:
Is there any way to count the number of times a certain value appears in a range of fields on one record. I have a table with 25 yes/no fields in it and would like to count how many yes ticks there...
7
by: RC | last post by:
I have a form with five text boxes on it. The format for all the boxes is set as General Number. In four of the boxes the user can enter a number, the fifth box totals up the values in the other...
5
by: buddyr | last post by:
I have one table in microsoft access database. I need to perform calculation on a field- then a conditional statement between 2 fields. field2 - needs to be multiplied by 5 the answer needs to...
5
by: Genalube | last post by:
I am trying to count the number of owners that show up in a query (conveyQuery). The query will produce a column OwnName that will contain names like John Smith, Mike Jones, Frank Vaugn. Each of...
1
by: GRUNT | last post by:
As a beginer,Im trying to COUNT values in a single field where they meet the critria below., Then SUM then altogether. Coursename,enddate1 and enddate2 are Request.QueryStrings form an .ASP web...
5
by: stateemk | last post by:
I am trying to run two queries. One query is doing a count to figure out how many total sales there were each year based on the assessor. That query is working fine. On the other query, I'm trying...
10
Jerry Maiapu
by: Jerry Maiapu | last post by:
In my tabular (format) report I would like to count only the fields with “AOT” in a column Overtime. How do I do that in the report? I know this is possible in query but for certain reasons I want to...
4
by: gina farrow | last post by:
I have a form that has yes or no answer. I need to know how to count how many yeses and how many nos on the form. and then show a precentage of how many records said yes and no.
1
by: freedemi | last post by:
Hi, I have a form with a subform in access 2007. When i edit some fields in mainform everything was ok. The problem is when i change the value of primary key field in mainform lets say (id) field,...
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
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...

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.