Results 1 to 2 of 2
  1. #1
    dolovenature is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2012
    Posts
    14

    Query for excluding TOP N records

    Hi,

    I need to design a query which select all records excluding the Top 5 based on totalmarks.



    Example :- say I have 25 candidates and their total marks.
    The candidates are divided in TWO locations.

    I have to select all candidates except top 5 based on their total marks(for each location)

    Can anybody help me with the query?


    My 2nd question is...

    Can I generate a query that will only display the results of a table excluding the results of previous three queries? If yes, how??

    Regards

    saikat

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    How about some logic along these lines (just thinking and typing and ignoring location for the moment)

    Select studentID, studentinfo from students where
    studentID NOT IN (Select top 5 studentId from students where criteria for totalMarks)

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

Similar Threads

  1. Replies: 14
    Last Post: 09-21-2012, 11:12 AM
  2. Excluding phone numbers using a query
    By Scott O'Neal in forum Queries
    Replies: 1
    Last Post: 09-06-2012, 11:04 AM
  3. Replies: 8
    Last Post: 08-13-2012, 04:30 AM
  4. Excluding records that contain wildcards
    By AccessUser123 in forum Programming
    Replies: 3
    Last Post: 06-09-2011, 08:17 AM
  5. Excluding data in a query
    By lpdds in forum Queries
    Replies: 1
    Last Post: 12-16-2009, 08:06 PM

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