Hi , I have two data sets which have to merge by id. I want to select those records from patients who stayed at BUR hospital and had a record date on the day of their MI/or the closest date to their MI . I need one record per patient that is the most recent time according to the patient's event date and time at the BUR Hospital. Data set 1 ID EVENT EventDate 121 MI 12/1/2010 121 MI 5/3/2012 123 MI 3/04/2005 144 MI 5/01/2012 144 MI 6/15/2012 Data set 2 ID Hospital RecordDate 121 BUR 01/31/2001 121 FOLK 04/30/2004 121 FOLK 04/30/2004 121 BUR 12/31/2010 121 BUR 12/31/2010 123 BUR 5/31/2005 144 BUR 5/01/2012 144 DES 6/30/2012 144 DES 6/30/2010 144 BUR 7/31/2012 a Thank you for your assistance.
... View more