• Nice one Chris..

    I Understood (Hope) the requirement after seeing the query from Chris... Still not able to bring all the rows.. Not able to get the ID's doesn't have any records in Attend table

    Updated Query:

    Select A.ID, S.TestName,T.Term, T.EndDate,COUNT(A.PeriodNBR)/8 MissingDays

    from dbo.TestScores S

    join dbo.Attend A

    on A.ID = S.ID

    join dbo.Terms T

    on S.SchoolYR = T.SchoolYR

    and S.Term = T.Term

    and S.LocID = T.LocID

    left join dbo.Terms T1

    on S.SchoolYR = T1.SchoolYR

    and S.Term = T1.Term+1

    and S.LocID = T1.LocID

    Where A.DateABS between ISNULL (Dateadd(day,1,T1.EndDate),'2012-06-01') and T.EndDate

    group by A.ID,T.Term,S.TestName,T.EndDate

    [font="Verdana"]Regards,
    Rals
    [/font].