As it turned out, this isn't that hard, all I needed to do was remember my trusty DateRange function, modify it to on months instead of days, and it was off to the races. This type of code does make my head hurt a tiny bit, it packs a lot into it.
DECLARE @start DATETIME,
SET @start = '2007-04-01'
set @end = '2007-10-01'
SELECT YEAR(Currentdate) Year,
FROM Dbo.MonthRange(@start,@end )
JOIN Bugs Bug
ON YEAR(Currentdate) >= YEAR(Bug.Openedat)
AND MONTH(Currentdate) >= MONTH(Bug.Openedat)
AND YEAR(Currentdate) <= YEAR(ISNULL(Bug.Closedat,Currentdate))
AND MONTH(Currentdate) < MONTH(ISNULL(Bug.Closedat,DateAdd(MONTH,1,Currentdate)))
GROUP BY YEAR(Currentdate),MONTH(Currentdate)
I would get it into NHibernate on Sunday, should be fun, it is about the ninth select is the super report... :-)