Microsoft
Software
Hardware
Network
Question : Grab last two lab results
I need to grab the last two lab results from a table by date. How do I do this? I can grab max but not sure how to grab the last two. If there are 10 results I just want the last two
Answer : Grab last two lab results
select * from
(
select *,
rn=row_number() over (partition by patientid order by date desc) -- rank for each patient by latest date
from tbl
) SQ
where rn<=2 --- only top 2
Random Solutions
Accessing a Sharepoint foundation 2010 site from a pc not connect to the same AD
Deleting OEM Jobs
Is a trust required for ADMT?
datagridview - show values from fields when clicked on
Server Local Group to Domain Local Group
How to use C# code in a VB.NET project
How do I set a form to open when Access 2007 and/or 2010 opens a data base?
Default VLAN issues on a Powerconnect 6200
Search to details ..From details tp search i should get the screen as earlier as
cfapplication sessionTimeout question