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

  • Tammy-274861 (7/10/2014)


    The member 88888ANTHONY doesn't meet the requirements, because even though he is enrolled for 2013, he has a bigger than 45 days gap between 2013-05-31 00:00:00.000 and 2013-10-01 00:00:00.000.

    That is the problem I need to solve, how do I check for gaps like that when I can have one record per member or multiple.

    Thanks a lot in advanced.

    Tammy

    Tammy, I would like to clarify your requirements, because what you've shown is not exactly what I'd have expected from above. You want any person enrolled in 2013 who has never had more than a 45 day gap in their enrollment, ever, crossing over year lines but not looking past the 2013 enrollment year? That's what I understand from your data results.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA