Home Forums SQL Server 2005 T-SQL (SS2K5) finding gaps between termination date and next enrollment date and filter by gap >= 45 days for year 2013 RE: finding gaps between termination date and next enrollment date and filter by gap >= 45 days for year 2013

  • Hi Craig!

    Acually I need to apply the 45 days gap ONLY for the members that have enrollment throughout 2013. e.g.

    See the member below, I don't care the gap between the first termination date and the second enrollment date since it is not during 2013, but I do care for the gap between second termination date and third enrollment date and since it is less than 45 days this member would be considered enrolled continuously for 2013.

    universalmemberid enrollmentdate terminationdate

    1234JANE 1/1/2010 5/30/2012

    1234JANE 8/1/2012 2/1/2013

    1234JANE 3/1/2013 12/31/2013

    Thank you for reading my issue, Craig!

    Tammy