SELECT      dbo.Roster.personID as district_student_id, 'sect' + cast(dbo.Roster.sectionID as varchar) as district_group_id
FROM         dbo.Roster INNER JOIN
                      dbo.Trial ON dbo.Roster.trialID = dbo.Trial.trialID INNER JOIN
                      dbo.Calendar ON dbo.Trial.calendarID = dbo.Calendar.calendarID INNER JOIN
                      dbo.SchoolYear ON dbo.Calendar.endYear = dbo.SchoolYear.endYear AND dbo.SchoolYear.active = 1
WHERE     trial.active=1 and ((dbo.Roster.endDate IS NULL) OR
                      (dbo.Roster.endDate > GETDATE()))