larrydavid
Programmer
Hello, here's what I have for [Total Count] and [AVG of Total Count], but I am not seeing any difference in the results:
I'm hoping it is just some minor thing I'm overlooking but any help would be greatly appreciated.
Thanks,
Larry
Code:
--TOTAL Tx
SELECT DATEADD(hour, DATEDIFF(hour, getdate(), t.Timestamp), getdate()) AS TxHour,
COUNT(*) AS TxCount
FROM TEST t GROUP BY DATEDIFF(hour, getdate(), t.Timestamp)
ORDER BY TxHour
Code:
--AVG of TxCount
SELECT TxHour, AVG(TxCount) as [AVG_CLAIM/HR] FROM
(
SELECT DATEADD(hour, DATEDIFF(hour, getdate(), t.Timestamp), getdate()) AS TxHour,
COUNT(*) AS TxCount
FROM TEST t
GROUP BY DATEDIFF(hour, getdate(), t.Timestamp)
)x
GROUP BY TxHour
ORDER BY TxHour
I'm hoping it is just some minor thing I'm overlooking but any help would be greatly appreciated.
Thanks,
Larry