473,324 Members | 2,541 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,324 software developers and data experts.

Using HAVING COUNT SQL to return specific results

I have an audit report that opens based on a query of reviews for a certain quarter that have not been sent.

The issue I am having is that I only want the clients name to come up on my report once the unsent audit count reaches 10 or more.

Here is my SQL so far which works fine - I just need some guidance on only returning the result when the count of audits reaches 10+.

I read about HAVING COUNT however cannot get that to function correctly. Any help is much appreciated.

Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT tblQAAuditRecords20141.Provider
  2. FROM tblQAAuditRecords20141
  3. WHERE ((([tblQAAuditRecords20141].[QAQuarter])=[Enter QA Quarter]) And (([tblQAAuditRecords20141].[QAReportSent])=False))
Dec 4 '14 #1
1 2684
A bit of further research and came up with the following which works perfectly!

Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT tblQAAuditRecords20141.Assessor, COUNT(Provider)
  2. FROM tblQAAuditRecords20141
  3. WHERE ((([tblQAAuditRecords20141].[QAQuarter])=[Enter QA Quarter]) And (([tblQAAuditRecords20141].[QAReportSent])=False))
  4. GROUP BY Provider
  5. HAVING COUNT(Provider) >9;
Dec 4 '14 #2

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

Similar topics

9
by: Börni | last post by:
Hi, I have an sql query like this: SELECT column FROM table WHERE column1="3" AND column2="1" This query works perfectly if i run it in the command line, to be exactly it return two results. But...
2
by: Konstantin Zakharenko | last post by:
Hello, Our QA team have running a lot of test scripts (for automated regression testing), they run them on the different databases (Oracle/MS SQL). Several of those tests are dependent on the...
3
by: mashedpotatohead | last post by:
Does anyone have any recommendations on how to solve the following? I would like to have a query that selects ALL columns from a database, however only records that have a count of a certain column...
0
by: lkrubner | last post by:
The idea I'm trying to get at is that I want the tag info for the tag "photography", and I want the date, and I want a count of any comments a tag may have. This following query gets back all the ...
1
by: michael.martinek | last post by:
Greetings! I've recently been trying to do something, which apparently looks like it may be a little odd.. I'm not finding anything in the manuals or anywhere on the web where something similiar...
3
by: Auddog | last post by:
I have the following query that works in mysql: select id, order_no, price, count(item_no), sum(price) from production WHERE item_no = '27714' group by item_no; When I setup my query in php,...
2
by: AtCor | last post by:
SELECT Sheet1$. AS , CASE Sheet1$. WHEN 'CSPP100A2344' THEN '0' END AS Extension, SUBSTRING(Sheet1$., 1, 4) AS , SUBSTRING(Sheet1$., 5, 8) AS , SUBSTRING(Sheet1$., 1, 4) ...
1
by: Gary Wessle | last post by:
Hi can I use if( set.count(key) ) // element exists { // do something. } else if( !set.count(key) ) // it does not exist { // so something else.
2
by: Jason Stinson | last post by:
I am trying to create a small report and what I want to do is pull the same field in a query 4 times and I am trying to alias the field and also have it just count the number of records, not give me...
1
by: fran7 | last post by:
Hi, I have this query to get a drop down list and that works fine. The trouble is I need to select another field from the table to give it a where clause but if I try I get an error message. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.