declare @StartDate datetime, @EndDate datetime
set @StartDate = '2009-01-01'
set @EndDate = '2010-06-01'
Select Sundays=Count(*) From (Select Top (Datediff (day, @StartDate, @EndDate) +1)
[Date] = dateadd(day, ROW_NUMBER()
Over(order by c1.name, c2.name), convert(char(10),@StartDate-1,110))
From sys.columns c1
cross join sys.columns c2) x
Where datepart(dw,[Date]) = 1;
-----------------------------------------------------------------------------------------------
Output: Number of sundays between two date is 74 sundays.