Get top customers and rest group as one Name?

J

Juan

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
 
O

Ofer

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
 
J

Juan

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
 
O

Ofer

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.
 
O

Ofer

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
 
J

Juan

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.
 
Top