我有一些我正在尝试报告的性能数据。
我需要输出给我每个计数器每月每周的平均值。
这是使用日期/时间字段的查询(即'2012-01-01 00:00:00.750')
SELECT MachineName ,
CounterName ,
InstanceName,
CounterValue,
ObjectName,
CounterDateTime
FROM dbo.CounterDetails cdt
INNER JOIN dbo.CounterData cd ON cdt.CounterID = cd.CounterID
INNER JOIN DisplayToID d ON d.GUID = cd.GUID
WHERE MachineName = '\\SERVER1'
AND CounterDateTime BETWEEN '2012-01-01 00:00:00.750' AND '2012-01-31 23:59:00.750'
GROUP BY ObjectName, CounterName, InstanceName, CounterValue, CounterDateTime, MachineName
ORDER BY CounterDateTime
感谢回复