Results 1 to 6 of 6
  1. #1
    TommyRex is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    3

    How to pull lowest value?

    Hello, All,

    Thank you for your help.

    I'm working with Access 2007 and need to learn how to pull the lowest value for a particular ID.

    For Example:

    Patient Procedure Procedure Rank
    John Smith 12450 3
    John Smith 42258 8


    John Smith 30114 2
    Mike Jones 44454 5
    Mike Jones 13534 9


    How do I I set up a query so that the only records that pull are John Smith's with Procedure Rank 2 (his lowest) and Mike Jones' with Procedure Rank 5 (his lowest)? I am not interest in the other...only the lowest for each Patient.

    Any ideas,

    Thank you, Tom

  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,640
    This technique, with Min instead of Max:

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

  3. #3
    TommyRex is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    3
    I not sure I'm following this:

    First, I constructed a make table query where I joined my patient records table and code rank table pulling Patient ID and Code Rank (both put in the new table).

    I've now taken this table and joined it with my original patient ID table, but rather than just getting the primary code (lowest rank) for John Smith, etc. I'm again getting all the codes for both patients.

    What am I doing wrong?

    Thanks,
    Tom

  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,640
    Not sure; you're using some other method. I wouldn't use a make table query, but are you joining on both fields?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    TommyRex is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    3
    Yeah, I'm not following the directions from your link. I thought it asked me to make a table in step one.

    Do you know if any other way to explain it?

    Thank you, Tom

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    My method? The first step is just a query, which the second query uses like a table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Query to find lowest value
    By AccessNubie in forum Access
    Replies: 3
    Last Post: 11-30-2009, 07:54 AM
  2. Pull info into a calendar?
    By C-Clear in forum Access
    Replies: 4
    Last Post: 10-14-2009, 01:52 AM
  3. Replies: 1
    Last Post: 10-06-2009, 02:00 AM
  4. Pull all text that preceeds a /
    By ahightower in forum Queries
    Replies: 3
    Last Post: 01-27-2009, 09:36 AM
  5. Replies: 1
    Last Post: 08-22-2006, 04:27 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