SELECT count(*), DateAdd(second, -DatePart(second, clientTime) , DateAdd(ms, -DatePart(ms, clientTime), clientTime)) FROM dbo.V_COMBINED WHERE (sessionId = '122b') AND (type = N'sys_goodaction') AND (paraName = 'value') GROUP BY DateAdd(second, -DatePart(second, clientTime) % 5 ,DateAdd(ms, -DatePart(ms, clientTime), clientTime))