Q&A for community managers, administrators, and moderators
FROM Users u
-- based on the estimate of 8760 hours per year
,COUNT(*) as [Count]
SELECT CASE WHEN a.AgeYearsIntTrunc < 2 then 'Under 2 Years'
when a.AgeYearsIntTrunc between 2 and 4 then '2-4'
when a.AgeYearsIntTrunc between 5 and 9 then '5-9'
when a.AgeYearsIntTrunc between 10 and 12 then '10-12'
end as Age_Range
,DATEDIFF(hour, u.creationDate,GETDATE())/8760 AS AgeYearsIntTrunc
FROM Users u ) a ) age
Group By age.age_range