Results 1 to 4 of 4
  1. #1
    Rhino373 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    May 2011
    Posts
    65

    Query Help

    I'm having a time getting what I want from a query. I have a table that looks like this:



    Table1ID Table2ID Matched
    1111 2222 1
    1111 3333 2
    1111 4444 3
    1111 5555 1
    2222 3333 6
    3333 2222 1
    3333 8888 4

    I want each Table1ID and the associated Table2ID where Matched is the greatest. So in the example above I only want to return 3 records. They would be:

    1111 4444 3
    2222 3333 6
    3333 8888 4

    I'm comparing 2 tables over 6 different criteria. The matched column tells over how many criteria they matched. So it's impossible for these records to match exactly over all criteria but if they match enough times its good enough.

    Can someone point me in the right direction for this query?

    Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Sounds like this concept will work:

    http://www.baldyweb.com/LastValue.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Rhino373 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    May 2011
    Posts
    65
    Thanks, exactly what I need

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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