Results 1 to 3 of 3
  1. #1
    Ciaran is offline Novice
    Windows 8 Access 2007
    Join Date
    Aug 2015
    Posts
    2

    Selecting hihest instance in a tbl

    Hey,
    I’ve got a tbl with non-unique IDs and type.
    I want to query the tbl for one instance of each ID and the highest type.
    So looking at the tbl below
    ID Type


    A 1
    A 2
    B 2
    B 3

    I want to return the data below only
    ID Type
    A 1
    B 2

    Can anyone help me?
    Regards,
    C

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Try an aggregate GROUP BY (TOTALS) query. Use the Query Designer.

    So the lowest number is the highest type?

    SELECT ID, Min([Type]) AS Highest FROM tablename;
    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.

  3. #3
    Ciaran is offline Novice
    Windows 8 Access 2007
    Join Date
    Aug 2015
    Posts
    2
    Thanks this helps

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

Similar Threads

  1. Replies: 2
    Last Post: 07-14-2015, 11:39 AM
  2. Replies: 10
    Last Post: 12-29-2013, 03:26 PM
  3. Replies: 5
    Last Post: 10-11-2013, 07:29 AM
  4. Replies: 5
    Last Post: 09-14-2012, 04:56 PM
  5. Multiple Instance Form
    By steve.roic@bellsouth.net in forum Forms
    Replies: 0
    Last Post: 05-19-2010, 11:18 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