select [DateTime (UTC)],
sum([messages sent external]) as 'messages sent external',
sum([messages sent internal]) as 'messages sent internal',
sum([messages received external]) as 'messages received external',
sum([messages received internal]) as 'messages received internal',
max([Message Latency Internal High]) as 'Message Latency Internal High',
max([Message Latency Internal Avg]) as 'Message Latency Internal Avg' from dbo.Monthly_MailFlowStats_2014_03 group by [DateTime (UTC)] order by [DateTime (UTC)] asc
結果顯示datetime中每天每小時的所有數據。我是否可以將日期時間修剪爲日期,以便結果顯示當天的數據而不是一天中的小時?T-SQL組按日期而不是日期時間
This:
2014-03-01
instead of:
2014-03-01 00:00:00.000
2014-03-01 01:00:00.000
2014-03-01 02:00:00.000
我真的很感謝大家的幫助。隱喻有我正在尋找的答案。謝謝你們! – PdeRover