Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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
Author
Message
Posted Friday, September 7, 2012 3:11 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

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
10:00-11:00

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

Any help on this??

Thanks
Varsha
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: 2 days ago @ 3:39 PM
Points: 340, Visits: 797
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.

DATEPART(hh, GETDATE())

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

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

Hope that helps.

John
Post #1356946
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse