--select * from dbo.PerfmonCounterHistory
SELECT $partition.TwoYearDateRangePFN(o.CreatedDateTime) 
			AS [Partition Number]
	, min(o.CreatedDateTime) AS [Min Date]
	, max(o.CreatedDateTime) AS [Max Date]
	, count(*) AS [Rows In Partition]
FROM dbo.PerfmonCounterHistory AS o
WHERE $partition.TwoYearDateRangePFN(o.CreatedDateTime) in (1, 2,3)
GROUP BY $partition.TwoYearDateRangePFN(o.CreatedDateTime)
ORDER BY [Partition Number]
GO