Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2005
    Posts
    55

    Red face Unanswered: Filtering in reports

    I have a report based on a query which i have grouped by

    State, business unit then employee

    I only need the top 20 employees for each business unit,,,how do i go about displaying only 20 records in each group

    I know how to use the top values query to get the 20 values for the whole report, but in this instance i need the top 20 values for each group

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    One way (just a suggestion - others might have a better suggestion) is to do it by opening a recordset in vba with a select statement that orders it descending for the field you want and then do a loop of 1 to 20, opening another recordset and appending to a "temp table" which the report is then based off of.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •