• Chris,

    I substituted this line in your code with this and it worked.

    --AND a.DateABS BETWEEN ISNULL(x.StartDate,'19000101') AND t.EndDate

    AND a.DateABS BETWEEN ISNULL(@FirstDay,'19000101') AND t.EndDate

    @FirstDay was set to '2012-08-14'

    This got me the desired results for the test data I supplied. Now I need to test against Prod data.

    Thanks again!!

    Sqlraider