select top 1000 DATEADD(MINUTE, -1 * DATEPART(MINUTE, CON...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

select 
top 1000
DATEADD(MINUTE, -1 * DATEPART(MINUTE, CONVERT(SMALLDATETIME, CreationDate)), CONVERT(SMALLDATETIME, CreationDate)) as [Hour],
COUNT(1) as [Number]
from Comments
where
id > 2205000 and
Text like '%programmers.stackexchange.com%'
or Text like '%programmers.se%'
group by DATEADD(MINUTE, -1 * DATEPART(MINUTE, CONVERT(SMALLDATETIME, CreationDate)), CONVERT(SMALLDATETIME, CreationDate))
order by DATEADD(MINUTE, -1 * DATEPART(MINUTE, CONVERT(SMALLDATETIME, CreationDate)), CONVERT(SMALLDATETIME, CreationDate)) desc

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results