Get top customers and rest group as one Name?

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

Guest

Hi using 97 crosstab query,
Is it possible to get Top 20 customers and the rest group as OTHERS?
Example, I have 240 customers so I want to
Sort by descending to get top customers. So I want to take the 20 and the
rest group as one Customer called
OTHERS? Not sure if I would have to do two queries or if this is even
possible.
Any suggestion woudl be very appreciative.

Thanks,

Juan
 
I will use three queries
1. "select top 20 * from MyTable"
2. Group by query, that doesnt include the records from query 1
3. union query that includes query 1 and 2
 
Hello Ofer,
how would I get query 2? Would I get table and also query? How would I set
this up in the query design?

Please advsie

thanks,
Juan
 
You can use the query wizard and select unmatch records query, select the
table and query1 in this query, and after you get the unmatch records, change
it to a group by.
 
IF YOU CAN'T get the query wizard to work, then it should look like that

SELECT MyTable1.* FROM MyTable2 RIGHT JOIN MyTable1 ON MyTable2.KeyField =
MyTable1.KeyField
WHERE MyTable2.KeyField Is Null

This query example return the all the records from table1 that are not in
table2, I'm using a right join between the two KeyField fields, and ask for
all the KeyField that are
null in table 2 which they are not there
Hope that help
 
Hello Ofer,
thanks alot for your help. This seems to give me what I want.

Really appreciated all the help u provided.

Thanks again,

Juan.
 
Back
Top