Link to home
Start Free TrialLog in
Avatar of ddschreck01
ddschreck01

asked on

extract records with the smallest value per group

I have a table containing the following

  Acct #       Collection Date/Time       Result Date/Time       Clinical Event
000005        1/1/2014 00:10:00           1/1/2014 00:42:00     Troponin-T
000005        1/1/2014 00:15:00           1/1/2014 00:20:00     Troponin-I
000005        1/1/2014 01:30:00           1/1/2014 02:10:00     Troponin-T
001002        1/3/2014 23:59:00           1/4/2014 00:45:00     Troponin-T
001002        1/4/2014 05:20:00           1/4/2014 05:25:00     Troponin-I

I need a query that would pull the entire record with the earliest result time for each account.  

For Acct # 0005, I need the record with result date/time of 1/1/2014 00:20:00 (2nd rec)
For Acct # 1002, I need the record with result date/time of 1/4/2014 00:45:00 (4th rec)
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ddschreck01
ddschreck01

ASKER

Thank you very much - that worked perfectly.