admin管理员组

文章数量:1289543

I want to group data by dateparts - Year, Month, Date and Hour. It should be like in Excel pivot table, when you click on + and group is hide/unhide. How to do it? Should I prepare date on sql in some way? I have added an example, how it should looks like.

I want to group data by dateparts - Year, Month, Date and Hour. It should be like in Excel pivot table, when you click on + and group is hide/unhide. How to do it? Should I prepare date on sql in some way? I have added an example, how it should looks like.

Share Improve this question asked Feb 19 at 17:59 Novitskiy DenisNovitskiy Denis 1478 bronze badges 2
  • 1 Datepart year in sql will get you the year. Then group on the years and then look into expand collapse options that are available. (Toggle visibility) – Harry Commented Feb 19 at 18:57
  • 1 You can do this in SQL as Harry suggested. You can also do this in SSRS. For example, create a row group and use the following expression =YEAR(Fields!myDateField.Value). You can also use the same expression for the 'cell' value. Create child groups for MONTH(), DAY() and HOUR() then set the initial visibility on each group to whatever you want. – Alan Schofield Commented Feb 20 at 11:08
Add a comment  | 

1 Answer 1

Reset to default 0

I found a desicion - need to created stepped report Some useful links:

https://sqldusty/2011/07/23/creating-stepped-reports-with-ssrs-2008/

https://learn.microsoft/en-us/sql/reporting-services/report-design/create-a-stepped-report-report-builder-and-ssrs?view=sql-server-2017

本文标签: reporting servicesGroup by dateparts in SSRSStack Overflow