Distribution of questions per hour of the day for a particular tag.
Q&A for people looking to bypass life's everyday problems with simple tricks
-- Questions by Hour of Day -- Distribution of questions per hour of the day for a particular tag. select str(datepart(hour,p.creationdate)) + ':00 ~ ' + str((datepart(hour,p.creationdate)+1) % 24) + ':00' as Hour, count(datepart(hour,p.creationdate)) as '# of questions' from Posts as p join PostTags as pt on pt.postid = p.id join Tags as t on pt.tagid = t.id where t.tagname = ##Tag:string## and p.PostTypeId = 1 -- 1 is question, 2 is answer group by datepart(hour, p.creationdate)