SELECT GroupId, min(CalendarDate) as StartDate, max(CalendarDate) as EndDate
FROM CenterDateExclusionSetting
WHERE CenterGUID = @CenterGUID
GROUP BY GroupId
HAVING max(CalendarDate) >= CAST(GETDATE() AS date)
------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/