Consulting

Results 1 to 4 of 4

Thread: Only return top 5 records per category

  1. #1
    VBAX Regular
    Joined
    Oct 2008
    Posts
    69
    Location

    Only return top 5 records per category

    Here is the query..what I want to have returned is only the top 5 records (for each Sum([Placings & Points].Points) for each of the Awards.[SPHO-Ohio Approved Classes Awards]..

    So what I have are about 25 separate awards...based on the sum of the points earned. And I need to return only the hihgest 5 total points for each of the awards



    SELECT Awards.[SPHO-Ohio Approved Classes Awards], ) AS SumOfPoints, [2012 Points].Members
    FROM (Awards INNER JOIN (Classes INNER JOIN (Events INNER JOIN [2012 Points] ON Events.ID = [2012 Points].[Show or Event]) ON Classes.ID = [2012 Points].Class) ON Awards.ID = Classes.[Award Division]) INNER JOIN [Placings & Points] ON [2012 Points].Placing = [Placings & Points].ID
    WHERE (((Events.[SPHO Show])=-1))
    GROUP BY Awards.[SPHO-Ohio Approved Classes Awards], [2012 Points].Members
    ORDER BY Awards.[SPHO-Ohio Approved Classes Awards], Sum([Placings & Points].Points) DESC;

  2. #2
    VBAX Regular
    Joined
    Oct 2008
    Posts
    69
    Location
    Can anyone help me out here?

  3. #3
    VBAX Tutor mohanvijay's Avatar
    Joined
    Aug 2010
    Location
    MADURAI
    Posts
    268
    Location
    Can you please post sample data and desired output in excel or access format?

  4. #4
    VBAX Tutor
    Joined
    Nov 2007
    Posts
    257
    Location

Posting Permissions

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