S
saalford
I'm using the query design view to take a list of buyers and usin
total, to count the number of times they appear...so far so good. Th
query returns something like
buyerID1(1)
buyerID2(3)
buyerID3(1)
buyerID4(3)
buyerID5(2),ect. What I need now is to set the criteria to only retur
the buyers who have the max count, buyers 2&4. I looked at the SQL vie
and tried adding Max infront of the Count, but I get an error abou
aggregate functions in the expression.
This gives me the counts
SELECT [Sale Lots].[Buyer ID], Count([Sale Lots].[Buyer ID]) A
[CountOfBuyer ID]
FROM [Sale Lots]
GROUP BY [Sale Lots].[Buyer ID];
Get the error when I try
SELECT [Sale Lots].[Buyer ID], Max(Count([Sale Lots].[Buyer ID])) A
[CountOfBuyer ID]
Is this possible in Design view or do I need some kind of where claus
in SQL?
Thank in advance for any help.
Scot
total, to count the number of times they appear...so far so good. Th
query returns something like
buyerID1(1)
buyerID2(3)
buyerID3(1)
buyerID4(3)
buyerID5(2),ect. What I need now is to set the criteria to only retur
the buyers who have the max count, buyers 2&4. I looked at the SQL vie
and tried adding Max infront of the Count, but I get an error abou
aggregate functions in the expression.
This gives me the counts
SELECT [Sale Lots].[Buyer ID], Count([Sale Lots].[Buyer ID]) A
[CountOfBuyer ID]
FROM [Sale Lots]
GROUP BY [Sale Lots].[Buyer ID];
Get the error when I try
SELECT [Sale Lots].[Buyer ID], Max(Count([Sale Lots].[Buyer ID])) A
[CountOfBuyer ID]
Is this possible in Design view or do I need some kind of where claus
in SQL?
Thank in advance for any help.
Scot