Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LIMIT NUMBER OF RECORDS TO 5....

Status
Not open for further replies.

ddbrook

Programmer
Aug 19, 2002
17
0
0
US
I have customer numbers that can have multiple account numbers, But I need to show only 5 of each account numbers.
I made a query that shows me the customer numbers that has > 5 account numbers:

Cust#,CustCount
16180,111
16491,106
25762,49

So I would need to keep <= 5 and delete all the others.

Does anyone have any suggestions??
I would greatly appreciate.

Thanks,
DDBROOK
 
There are ways to approach a &quot;top n&quot; set of data, I don't have those references in front of me.

Alternatively, you can run this scenario in vba behind a form or report (using a For i = 1 to n, etc...)

However, sit tight long enough, and there are several gurus at this site who are geniuses when it comes to manipulating SQL in the Query Grid; they'll probably provide you with a solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top