Results 1 to 4 of 4

max

  1. #1
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727

    max

    All I need help fast please. I am using access 2010. I have a table where I need to pull out the
    highest value. But sometimes; there are two or more with the same high value. I
    need a way to retreive the first highest value. I've done this before a while


    ago and I can't make it work again. I started off with grouping highest value
    but are getting all three same values. Please help. Here is an example of what I need:
    Thanks
    Code:
    Group   Name     Rate
    1            Joe       3
    1            Sue           3
    1            Jack          2
    2    Mary       2
    2            Sam          3
    2            Sue           3
    3            Nan          2
    3    Josh      1
    Need it to look like this.
    Code:
    Group   Name     Rate
    1            Joe       3
    2            Sam          3
    3            Nan          2

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Breaking ties can be tricky.

    Try this:

    SELECT Table1.*, *
    FROM table1
    WHERE (((Table1.[ID])=DMin("ID","Table1","Group='" & [Group] & "' AND Rate=" & DMax("Rate","Table1","Group='" & [Group] & "'"))));
    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
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727
    ok thanks. I'll try this n post back.

  4. #4
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727
    It worked on my test db! I'll try it at work tomorrow. thanks!

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

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