473,804 Members | 3,196 Online
Bytes | Software Development & Data Engineering Community
+ 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 13692
NeoPa
32,579 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,579 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
2550
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 have access to using a single sql statement and it cannot be dynamic SQL or a stored procedure (this is a limitation based on the reporting tool we use). The conditions can be any combination of "and" and "or" operators. I have seen posts (and...
2
6606
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. "Heart Disease,Hyper Tyroid,Cancer" etc. I would like to search via combo box for any one or more than one value in this field, ie-what patients have Heart Disease or Cancer by selecting these disorders off the combo box list. Any help would be...
5
18284
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 display the number of times a certain value appears in a certain field (i.e. perform a ‘count'). I will be doing this for many values in many fields so do not wish to have scores of queries to build my report.
3
2138
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 is easy: SELECT field1, count(field1) as cntnr FROM table group by field1
32
14915
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 ((someString.IndexOf("something1",0) >= 0) || ((someString.IndexOf("something2",0) >= 0) ||
22
12497
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=" & msDbFilename moConn.Properties("Persist Security Info") = False moConn.ConnectionString = msConnString moConn.CursorLocation = adUseClient moConn.Mode = adModeReadWrite' or using default...same result
1
5184
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 contains a referer string. table = stats_2007_01 table = stats_2007_02 table = stats_2007_03 and so on.... field = string (200) I can query a single table and return the result i expect with this statement
2
12082
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 contains "AAA" the count is X. if the field contains "CCC" the count is Y. if the field contains "Stop" then count is Z. I have tried several ways and can not seem to get any where. I get the same count for all string values. Can some one...
2
2453
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 or XML, so bear with me. The project is about 95% complete, but the XML parser needs quite
0
10561
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10302
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9132
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6845
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5505
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4277
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 we have to send another system
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2976
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.