Ah ha!You rock!!Is there any way to sort the columns now that I have the data I
want?When I click on the column head, all the rows disappearMike
From: Stephen Markson <[email protected]>
To: [email protected]
Sent: Wednesday, October 14, 2015 1:56 PM
Subject: [RBASE-L] - RE: extracting the most recent data
<!--#yiv2542047982 _filtered #yiv2542047982 {font-family:Helvetica;panose-1:2
11 6 4 2 2 2 2 2 4;} _filtered #yiv2542047982 {font-family:"Cambria
Math";panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv2542047982
{font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}#yiv2542047982
#yiv2542047982 p.yiv2542047982MsoNormal, #yiv2542047982
li.yiv2542047982MsoNormal, #yiv2542047982 div.yiv2542047982MsoNormal
{margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New
Roman", serif;}#yiv2542047982 a:link, #yiv2542047982
span.yiv2542047982MsoHyperlink
{color:blue;text-decoration:underline;}#yiv2542047982 a:visited, #yiv2542047982
span.yiv2542047982MsoHyperlinkFollowed
{color:purple;text-decoration:underline;}#yiv2542047982
p.yiv2542047982msonormal, #yiv2542047982 li.yiv2542047982msonormal,
#yiv2542047982 div.yiv2542047982msonormal
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;font-family:"Times New
Roman", serif;}#yiv2542047982 p.yiv2542047982msochpdefault, #yiv2542047982
li.yiv2542047982msochpdefault, #yiv2542047982 div.yiv2542047982msochpdefault
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;font-family:"Times New
Roman", serif;}#yiv2542047982 span.yiv2542047982msohyperlink {}#yiv2542047982
span.yiv2542047982msohyperlinkfollowed {}#yiv2542047982
span.yiv2542047982emailstyle17 {}#yiv2542047982 p.yiv2542047982msonormal1,
#yiv2542047982 li.yiv2542047982msonormal1, #yiv2542047982
div.yiv2542047982msonormal1
{margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New
Roman", serif;}#yiv2542047982 span.yiv2542047982msohyperlink1
{color:#0563C1;text-decoration:underline;}#yiv2542047982
span.yiv2542047982msohyperlinkfollowed1
{color:#954F72;text-decoration:underline;}#yiv2542047982
span.yiv2542047982emailstyle171 {font-family:"Calibri",
sans-serif;color:#1F497D;}#yiv2542047982 p.yiv2542047982msochpdefault1,
#yiv2542047982 li.yiv2542047982msochpdefault1, #yiv2542047982
div.yiv2542047982msochpdefault1
{margin-right:0cm;margin-left:0cm;font-size:10.0pt;font-family:"Times New
Roman", serif;}#yiv2542047982 span.yiv2542047982EmailStyle27
{font-family:"Calibri", sans-serif;color:#1F497D;}#yiv2542047982
.yiv2542047982MsoChpDefault {font-size:10.0pt;} _filtered #yiv2542047982
{margin:72.0pt 72.0pt 72.0pt 72.0pt;}#yiv2542047982
div.yiv2542047982WordSection1 {}-->Get rid of rdate_ in the GROUP BY
Regards, Stephen Markson The Pharmacy Examining Board of Canada 416.979.2431
x251 From: [email protected] [mailto:[email protected]]On Behalf Of Michael
J. Sinclair
Sent: October-14-15 1:43 PM
To: Stephen Markson
Subject: [RBASE-L] - RE: extracting the most recent data Hi Buddy, here is
what i tried bro (max(rdate_)) patnumbr cptcode service from todo0 group by
rdate_ patnumbr cptcode service instead of giving me just the last test, it
gives me every test, as if it is ignoring the MAX function What am I doing
wrong? 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 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