Problem using with Max() aggregate function

EndersG

Registered User.
Local time
Today, 17:25
Joined
Feb 18, 2000
Messages
84
I have a table in MS Access named Invoices containing the following values:

Name Invoice
Jim 101
Jim 102
Jane 103
John 104
Jane 105
John 106
John 107
Jim 108
Jim 109
Jim 110

The following query gives me the results you see below:

SELECT Name, Count(Invoice) AS CountOfInvoice
FROM Invoices
GROUP BY Name;

Name CountOfInvoice
Jane 2
Jim 5
John 3

Ultimately, I want to design a SINGLE query that returns ONLY the Max(CountOfInvoice). In this case: 5.

Can anyone help me?
 
You need to do the first query like you have and the insert that query into another query and use only the CountOfInvoice column and select MAX instead of GROUPBY.
 
Thanks bob, but is it possible you can give me an example using the data I've provided? Thanks.
 
mc01.png



mc02.png



mc02a.png



mc03.png



mc03a.png
 
Much appreciated bob, especially the visual aids.

You're a lifesaver!
 

Users who are viewing this thread

Back
Top Bottom