Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return several rows with most recent date

Status
Not open for further replies.

gk17

Technical User
Sep 6, 2013
86
US
I want my report to return the most recent data for various lab test & dates. For example:


Patient|LabTest|Value|Date
Test,AB|Test123|23|1/12/2015 7:00AM
Test,AB|Test234|28|1/9/2015 6:15AM
Test,AB|Test123|30|1/9/2015 6:15AM
Test,AB|Test567|6.5|1/2/2015 5:48PM
Test,AB|Test123|28|12/30/2014 12:55AM
Test,AB|Test234|25|12/15/2014 1:00PM
Test,AB|Test567|8.1|12/14/2014 2:40PM
Test,AB|Test789|35|11/30/2014 8:47AM

I have a record select criteria set to search for specific Lab Tests (ex: Test123, Test234 & Test567 are included and Test789 should be excluded)

I want it to return the most recent rows for the 3 lab tests. In this case, they should be:

Test,AB|Test123|23|1/12/2015 7:00AM
Test,AB|Test234|28|1/9/2015 6:15AM
Test,AB|Test567|6.5|1/2/2015 5:48PM

Thanks.
 
Hi,

But there are four LabTest values in your example??? What about Test789?
 
The column will have more than 4 Lab Tests. I have set the selection criteria to only include the 3 I mentioned. I only want those 3 returned and only the latest date for each of them. Older dates should be excluded.
 
Group by Patient, then by LabTest and then by descending order of Date.
Copy Patient, LabTest, Value and Date fields to Group Footer #2.
Suppress all sections except GF#2.
 
Thanks BettyJ. Got the order of things messed up but that fixed it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top