Thanks Buddy! I had the syntax wrong, yours works perfectly.Mike

      From: Buddy Walker <[email protected]>
 To: [email protected] 
 Sent: Monday, October 12, 2015 8:54 PM
 Subject: [RBASE-L] - RE: extracting the most recent data
   
<!--#yiv0693404018 _filtered #yiv0693404018 {font-family:"Cambria 
Math";panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv0693404018 
{font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}#yiv0693404018 
#yiv0693404018 p.yiv0693404018MsoNormal, #yiv0693404018 
li.yiv0693404018MsoNormal, #yiv0693404018 div.yiv0693404018MsoNormal 
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New 
Roman", serif;}#yiv0693404018 a:link, #yiv0693404018 
span.yiv0693404018MsoHyperlink 
{color:#0563C1;text-decoration:underline;}#yiv0693404018 a:visited, 
#yiv0693404018 span.yiv0693404018MsoHyperlinkFollowed 
{color:#954F72;text-decoration:underline;}#yiv0693404018 
span.yiv0693404018EmailStyle17 {font-family:"Calibri", 
sans-serif;color:#1F497D;}#yiv0693404018 .yiv0693404018MsoChpDefault 
{font-size:10.0pt;} _filtered #yiv0693404018 {margin:1.0in 1.0in 1.0in 
1.0in;}#yiv0693404018 div.yiv0693404018WordSection1 {}-->Mike  You could try    
 SELECT  MAX(datecolumn), patientnumber,testcode from sometable group by 
patientnumber, testcode, datecolumn  Buddy  From: [email protected] 
[mailto:[email protected]] On Behalf Of Michael J. Sinclair
Sent: Monday, October 12, 2015 8:23 PM
To: [email protected]
Subject: [RBASE-L] - extracting the most recent data  Hi all  I have a very 
long skinny table, 3 columns. 
A date, a patient number and test code.  I want to extract the rows that are 
the most recent test code for each patient.  If patient #3000 has had testcode 
# 80015 10 times over the last year, then I only want the most recent row for 
that testcode/patient combination  Is there a single command that can do that?  
Mike

  

Reply via email to