Hi
I have a patient database for patients that could be in hospital over more than one fiscal year. A fiscal year is April 1 to March 31. I have 3 years worth of data and in fact some of these patients may not be discharged by the end date of the period (March 31, 2009).
I have the admit date and the discharge date (if there is one) and wish to create a column of days that occur over 2006/07, 2007/08 and 2008/09. Admission date doesn't count as a day so April 1, 2006 to March 31, 2007 would be 364 days.
Below is some example data and what I would expect to see:
[tt]AdmitDate DisDate 2006 2007 2008
Mar 16, 2007 May 6, 2006 33 0 0
Apr 1, 2006 May 6, 2007 364 36 0
Sep 5, 2008 0 0 207[/tt]
So what formulae would I use to accomplish this? Thanks.
I have a patient database for patients that could be in hospital over more than one fiscal year. A fiscal year is April 1 to March 31. I have 3 years worth of data and in fact some of these patients may not be discharged by the end date of the period (March 31, 2009).
I have the admit date and the discharge date (if there is one) and wish to create a column of days that occur over 2006/07, 2007/08 and 2008/09. Admission date doesn't count as a day so April 1, 2006 to March 31, 2007 would be 364 days.
Below is some example data and what I would expect to see:
[tt]AdmitDate DisDate 2006 2007 2008
Mar 16, 2007 May 6, 2006 33 0 0
Apr 1, 2006 May 6, 2007 364 36 0
Sep 5, 2008 0 0 207[/tt]
So what formulae would I use to accomplish this? Thanks.