Results 1 to 6 of 6
  1. #1
    zachariack is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2019
    Posts
    6

    how to sum highest 5 values in access crosstab query

    Sl No Name Subject Exam 1 Exam 2 Exam 3 Exam 4 Exam 5 Exam 6 Exam 7 Exam 8 Exam 9 Exam 10 Total Sum of Highest 5
    1 AAAA English 89 88 87 86 85 98 82 96 95 90 896 ????
    2 BBBB English 95 68 9 96 32 94 63 56 56 65 634 ????
    2 CCCC Maths 95 68 9 96 32 94 63 56 56 65 634 ????


  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    arnelgp is offline Novice
    Windows 8 Access 2021
    Join Date
    Apr 2020
    Location
    Philippines
    Posts
    2
    you need to create a Top 5 Query first(1_Top5BySINo on demo and 2_SumTop5Score an append query), then append it to a temporary table.
    next, you create a Crosstab from your table joining the temporary table.
    Attached Files Attached Files

  4. #4
    zachariack is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2019
    Posts
    6

    Thumbs up

    Quote Originally Posted by arnelgp View Post
    you need to create a Top 5 Query first(1_Top5BySINo on demo and 2_SumTop5Score an append query), then append it to a temporary table.
    next, you create a Crosstab from your table joining the temporary table.
    Thank You for Your Reply...
    in this sample onle one subject, if it is more subjects, how ???

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    For TOP N per group, review http://allenbrowne.com/subquery-01.html#TopN
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    madpiet is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    154
    I have a dumb question... Does the table you're trying to get the top values from require a column with unique values so you don't get multiple records when you try to do a TOP(n)? I was trying it, and all the non-unique values would get pulled as if they were a single record.

    If this were SQL Server, I could add a ROW_NUMBER() column thing to each record, and then just take any that are less than X or whatever. (Some days I really dislike Access... and this would be one of those days)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 04-04-2018, 09:14 AM
  2. Highest Score sort in duplicate values
    By geocan2006 in forum Queries
    Replies: 3
    Last Post: 06-03-2016, 02:33 PM
  3. CrossTab Query - Blank Values
    By bullwinkle55423 in forum Queries
    Replies: 4
    Last Post: 07-17-2013, 01:59 PM
  4. Select 5 highest values
    By frozendmj in forum Queries
    Replies: 1
    Last Post: 04-19-2011, 03:18 PM
  5. How to sum values in Crosstab query?
    By Buakaw in forum Queries
    Replies: 3
    Last Post: 03-22-2011, 01:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums