Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reporting services SSRS图表按小时显示总计_Reporting Services - Fatal编程技术网

Reporting services SSRS图表按小时显示总计

Reporting services SSRS图表按小时显示总计,reporting-services,Reporting Services,我有以下数据: +--------------------------+---------------+ | Date Time | Number of Hit | +--------------------------+---------------+ | 2011-10-03 13:01:00 + 10 | 2 | | 2011-10-03 13:05:00 + 10 | 3 | | 2011-10-03 14:0

我有以下数据:

+--------------------------+---------------+
|        Date Time         | Number of Hit |
+--------------------------+---------------+
| 2011-10-03 13:01:00 + 10 |             2 |
| 2011-10-03 13:05:00 + 10 |             3 |
| 2011-10-03 14:01:00 + 10 |             4 |
| 2011-10-03 14:04:00 + 10 |             5 |
+--------------------------+---------------+
我想使用Reporting Services创建一个图表,显示:

13 - 5
14 - 9

基本上,我想按小时显示点击数。有人能告诉我怎么做吗?

取决于您有哪些其他要求,但在SQL查询中按小时分组可能最容易:

SELECT
   DATEADD(hour, DATEDIFF(hour, 0, myDateTimeColumn, 0)) AS TimeByHour,
   SUM(hitCount) as Hits
FROM
   WebRecordsTable
GROUP BY DATEADD(hour, DATEDIFF(hour, 0, myDateTimeColumn, 0))

然后在SSRS中创建一个图表,并将“点击数”字段拖到“值”部分。

您尝试了什么?你被卡在哪里了?您正在使用哪个版本的Reporting Services?你从哪里获得数据?我一直在使用Reporting Services创建图表,显示:13-514-9。你知道怎么做吗?或者只是想变得聪明一点?只是想以一种有帮助的方式变得聪明一点。。。从您最初的问题中,很难知道您遇到了什么具体问题,因此很难帮助您:如果您说您收到了错误消息,您将得到不同类型的帮助,而您只需要帮助编写查询。即使现在,我也不知道13-514-9是什么意思:这是时间范围吗?另外,SSRS在最近几次发布中已经有了很大的变化,所以在某处指明版本是很有帮助的。谢谢heaps@Jamie F。这不是我想要的安静,但是你的解决方案给了我提示。i、 我使用了datepart(hour,myDateTimeColum),然后使用group by.Sure。Yes Datepart()将按小时分组,与日期无关,而我的原始答案将按小时和日期分组。