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 autoexcrement!

    I would change this

    WHERE

    DATEDIFF(day, CTE1.terminationdate, CTE2.enrollmentdate) >= 45

    to this

    WHERE

    DATEDIFF(day, CTE1.terminationdate, CTE2.enrollmentdate) < 45

    to get the members with gap less than 45 days for 201, do you agree?

    I have to try to get my head around this.....sorry for being a bother!! 🙁

    Tammy