Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

How to group time into a range like 9:00-10:00 AM,10:00-11:AM etc in SSRS charts??? Expand / Collapse
Posted Friday, September 7, 2012 3:11 AM


Group: General Forum Members
Last Login: Friday, August 1, 2014 8:41 AM
Points: 101, Visits: 437
Hi All,

I have a trend chart showing total services per 1 hour time slot across the day. But I wanted to show another chart showing the total services across a time range, say for eg

Time Total Services

8:00 AM 6
9:00 AM 4
10:00 AM 2
11:00 AM 10

Now I have to group the time axis in the below way :

Time Range

8:00 -9:00
9:00 -10:00

how to group the time range by 1 hour hour time slot in ssrs

Any help on this??

Post #1355845
Posted Monday, September 10, 2012 12:21 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, October 25, 2016 2:28 PM
Points: 348, Visits: 897
If you're using a DATETIME, you can use the DATEPART function to get the hour and group on the value for the hour based on a 24 hour clock.


You could then group on the hour number and use some kind of CASE statement to give it a pretty name

WHEN DATEPART(hh, GETDATE()) = 14 THEN '2:00pm-3:00pm'
WHEN DATEPART(hh, GETDATE()) = 15 THEN '3:00pm-4:00pm'

Hope that helps.

Post #1356946
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse