R
robindra
Hi,
say I had some data where the cases have a start date and and end date
I need to know which years are covered by each case.
As each case can span several years I guess I need a column for eac
each year with a 'yes' and 'no' indicating whether the case include
that year
so for example
start date end date 2008 2009 2010 2011
12/03/08 14/05/10 y y y n
it seems to be more complex than I thought, e.g 2009 would include al
those cases with a start date in 2009, all those with an end date i
2009, but also any case where the start date is anytime before 2009 an
an end date after 2009.
So basically I need a function that identifys if a range of dates i
withing another range of dates. Does anyone know how?
I also have a secondary problem, once I have a year variable I also nee
to allocate how many days for each case fall within each year.
Ive put calender years for simplicity but really my data is financia
years.
Any help would be much appreciated
thank
+-------------------------------------------------------------------
+-------------------------------------------------------------------
say I had some data where the cases have a start date and and end date
I need to know which years are covered by each case.
As each case can span several years I guess I need a column for eac
each year with a 'yes' and 'no' indicating whether the case include
that year
so for example
start date end date 2008 2009 2010 2011
12/03/08 14/05/10 y y y n
it seems to be more complex than I thought, e.g 2009 would include al
those cases with a start date in 2009, all those with an end date i
2009, but also any case where the start date is anytime before 2009 an
an end date after 2009.
So basically I need a function that identifys if a range of dates i
withing another range of dates. Does anyone know how?
I also have a secondary problem, once I have a year variable I also nee
to allocate how many days for each case fall within each year.
Ive put calender years for simplicity but really my data is financia
years.
Any help would be much appreciated
thank
+-------------------------------------------------------------------
+-------------------------------------------------------------------