• drew.allen - Monday, February 5, 2018 1:39 PM

    So you're okay with someone who has a gap that crosses years?


    INSERT INTO #t(BeneficiaryID, EligYear, EligMonth )
    Select '12345678',2016,6 UNION
    Select '12345678',2016,7 UNION
    Select '12345678',2016,8 UNION
    Select '12345678',2016,9 UNION
    Select '12345678',2016,10 UNION
    Select '12345678',2017,3 UNION
    Select '12345678',2017,4 UNION
    Select '12345678',2017,5

    Drew

    Yep! The code will check for each member per year. So if a member has 3 months in 2 different years, her gets listed 2 times ( my requirement is to capture a member who has had 3 or more months in a given year )