Hi. I have a set of data where I need to split out the number of days a patient was hospitalized in a given year. I want a streamlined approach to this as I realize the dif function still requires a bit of coding and not exactly what I'd like. Any suggestions are appreciated, thx. Days FromDate EndDate 1 22NOV2011 22NOV2011 21 23NOV2011 13DEC2011 64 14DEC2011 15FEB2012 664 01JAN2010 26OCT2011 2191 01JAN2010 31DEC2015 1793 01JAN2014 28NOV2014 833 25MAR2010 04JUL2012 So the issue is the EndDates that extend into the following year. For instance in line 3, how do I process how many days of the total 64 are in 2011 and how many are 2012 and still create a flag for each year? This is what I'd like to end up with: Days FromDate EndDate CY2011 CY2012 Days2011 Days2012 1 22NOV2011 22NOV2011 1 0 1 0 21 23NOV2011 13DEC2011 1 0 21 0 64 14DEC2011 15FEB2012 1 1 18 46
... View more