Results 1 to 2 of 2
  1. #1
    bigchicagobob is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2013
    Posts
    18

    Filter out values that do not have max value


    Hello,

    I'm trying to create a list where I have a single value in column a [home], single value in column b [location] and single max value in column c rooms. For example, here is the raw data below.

    I'd like to filter out the [house 4 - omega - 1] row because there is another house with a greater number of rooms. How would i write this in a query or two?

    Home location Rooms
    house 1 alpha 4
    house 2 beta 3
    house 3 delta 5
    house 4 omega 1
    house 4 epsilon 12
    house 5 sigma 8

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    One way:

    1. First create an Aggregate Query which only has the Home and Rooms fields. Make it an Aggregate (Totals) Query, choosing "Maximum" for the Totals Row under the Rooms field. This will return a query of each House number with maximum number of rooms.

    2. Create a new query, linking your original table to the query you just created above on both the Home and Rooms fields. Then return all three fields from the Table.

    This should return what you want. Note, you could still get multiple rows for a single house number if there is a "tie" for maximum number of rooms for a single house.
    For example, if there was another record "for house 4" with 12 rooms, both records with 12 rooms would be returned.

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

Similar Threads

  1. SQL: Commands to Filter a Check Box's YES/NO Values?
    By warrenpage in forum Programming
    Replies: 8
    Last Post: 12-06-2013, 01:46 PM
  2. Combo Box filter not showing values
    By Chatholo in forum Forms
    Replies: 7
    Last Post: 08-01-2013, 08:53 AM
  3. Compiling a filter from List Box values
    By KristenAsh in forum Programming
    Replies: 8
    Last Post: 12-03-2012, 01:11 AM
  4. filter table by multiple values
    By TheShabz in forum Access
    Replies: 4
    Last Post: 11-01-2011, 05:34 PM
  5. Filter available values in a drop down list
    By petitmorsalin in forum Access
    Replies: 1
    Last Post: 12-13-2010, 09:39 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