Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2011
    Posts
    1

    Unanswered: How do I find the last record based upon a date?

    I have fields:

    PID, DatePerformed, NumResult

    I'v tried totals queries, but that yields weird results. When I try to select the max date and group by the PID, that is fine, however when I cascade the next query, it gives me the maxdate, but gives me all the NumResults with the last date (incorrectly-the actual date is changed to the max date).

    What is the most accurate way to get the last result for each PID? this is patient labs.

    Data looks like this

    PID, DatePerformed, NumResult

    1, 3/4/2011, 6.5
    2, 2/10/2011, 7.3
    1, 2/20/2009, 7.2
    2. 3/6/2011, 7.1
    1, 4/25/2009, 5

    I want to get this:

    1, 3/4/2011, 6.5
    2, 3/6/2011, 7.1

    I'm getting mixtures of numbers and dates, such that it may look like:

    1, 2/20/2009, 5
    2, 2/10/2011, 7.1

    Thanks!

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Sounds like you want this:

    Most recent value
    Paul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •