Query to get top sellers

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have imported an excel worksheet with information needed to obtain who my
top sellers are. I just can't get my query to tell me who the top 50 are.
I'm missing something here. I have the query done so that it will group my
sellers together & total the sales, but when I ask for the query to sort in
descending order & give me the top 50 it will not work. Can someone please
tell me what I'm doing wrong?

Or is there an easier way to do this?

Thank you!
 
Lisa

How are you asking Access to do this?

Post the SQL of your query.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
SELECT TOP 50 [January Data].Zone, [January Data].State, [January Data].[PNX
Code], [January Data].Agent, Count([January Data].[Case Count]) AS
[CountOfCase Count]
FROM [January Data]
GROUP BY [January Data].Zone, [January Data].State, [January Data].[PNX
Code], [January Data].Agent;
 
"Count of Case Count"?

What data do you have in the field named [Case Count]?

If that is already a count, you need to use "Sum", not "Count".

By the way, a table with a name like "January Data" is a strong clue that
your data is not well-normalized. Both you and Access will have to work
much harder if you have basically copied an Excel spreadsheet layout into
Access.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP


lisa s. said:
SELECT TOP 50 [January Data].Zone, [January Data].State, [January
Data].[PNX
Code], [January Data].Agent, Count([January Data].[Case Count]) AS
[CountOfCase Count]
FROM [January Data]
GROUP BY [January Data].Zone, [January Data].State, [January Data].[PNX
Code], [January Data].Agent;

--
lisa


Jeff Boyce said:
Lisa

How are you asking Access to do this?

Post the SQL of your query.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
When you are saying it does not work, what results are you getting?
using the TOP predicate can be misleading. It may return more than 50 if
there are ties. For example, if the top 3 return the same value, it will add
3 more rows because there are 3 that are the top 1.
 
Back
Top