473,473 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Multiple Count Values in Single Query. Is it possible?

jenkinsloveschicken
56 New Member
I am somewhat new to Access and have been tasked with creating a reporting database for my operation. The problem I am having is that I am needing to use the Count function to calculate total instances for each phone agent within the report, then use these counts to calculate a percentage for a report.

Sample recordset:

Specialist ID, Specialist Name, Brand Satisifaction, Specialist Satisfaction
111111 John Doe 4 4


Brand and Specialist Satisfaction are a range from 1-5. I am needing to count the number of entries per/Specialist that are >=4 as for Brand and Specialist Satisfaction and a count for total entries for the specialist.

Is it possible to do this within one query? I have no problem getting the values when I calculate each count in a separate query. I know this is probably a simple problem, but I have been trying to figure this out for a while now. Any help is much appreciated.

Gerald
Dec 8 '06 #1
3 13653
NeoPa
32,556 Recognized Expert Moderator MVP
I am somewhat new to Access and have been tasked with creating a reporting database for my operation. The problem I am having is that I am needing to use the Count function to calculate total instances for each phone agent within the report, then use these counts to calculate a percentage for a report.

Sample recordset:

Specialist ID, Specialist Name, Brand Satisifaction, Specialist Satisfaction
111111 John Doe 4 4


Brand and Specialist Satisfaction are a range from 1-5. I am needing to count the number of entries per/Specialist that are >=4 as for Brand and Specialist Satisfaction and a count for total entries for the specialist.

Is it possible to do this within one query? I have no problem getting the values when I calculate each count in a separate query. I know this is probably a simple problem, but I have been trying to figure this out for a while now. Any help is much appreciated.

Gerald
Expand|Select|Wrap|Line Numbers
  1. SELECT [Specialist ID], [Specialist Name],
  2.   Count([Specialist ID]) AS CountEntries,
  3.   Sum(IIf([Brand Satisfaction]>3,1,0)) AS CountBrand,
  4.   Sum(IIf([Specialist Satisfaction]>3,1,0)) AS CountSpecialist
  5. FROM [YourTable]
  6. GROUP BY [Specialist ID], [Specialist Name]
Dec 8 '06 #2
jenkinsloveschicken
56 New Member
Worked like a charm! Thank you for your help!


Gerald
Dec 8 '06 #3
NeoPa
32,556 Recognized Expert Moderator MVP
Worked like a charm! Thank you for your help!


Gerald
No problem. Thanks for the feedback. It's always nice to hear back and it shows a question has had an answer for anyone looking later :).
Dec 8 '06 #4

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

Similar topics

3
by: gregory.sharrow | last post by:
I need to secure a datawarehouse table at the row level based on 1 to many keys on that table. A user should only see the rows they have access to. I need to be able to figure out which rows they...
2
by: Jen F. | last post by:
I have inherited a medical database in which there are multiple values stored in a single field (ie. "Current Conditions" field might contain 1-20 different conditions, separated by comma (ie....
5
by: Cro | last post by:
Hello Access Developers, I'd like to know if it is possible to perform a count in an expression that defines a control source. My report is based on a query. In my report, I want a text box to...
3
by: Abhi | last post by:
Hi! I am wondering if this query is possible somehow: I have a table with many fields that all can have a value from 1 to 5. if I wanna see the count of each value from one field, then this...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
22
by: MP | last post by:
vb6,ado,mdb,win2k i pass the sql string to the .Execute method on the open connection to Table_Name(const) db table fwiw (the connection opened via class wrapper:) msConnString = "Data Source="...
1
by: ntocher | last post by:
Is it possible in a single query to search up to 12 tables for a similar text string and count the number each time a duplicate is found? I have a table for each month with a string field that...
2
by: Pete | last post by:
I need to create a single query (Not a SQL query) against a single table that counts the number of records in the table, where the single field "tmp" contains specific string values If the field...
2
by: Dahak | last post by:
It seems that my GoogleFu has failed me tonight and I'm hoping I can find some advice. I've inherited a ASP.NET project written in Visual Basic. I'm not too familiar with the .NET framework...
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...
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.