SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to group time into a range like 9:00-10:00 AM,10:00-11:AM etc in SSRS charts???


How to group time into a range like 9:00-10:00 AM,10:00-11:AM etc in SSRS charts???

Author
Message
var05
var05
SSC-Enthusiastic
SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)

Group: General Forum Members
Points: 183 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
JohnnyDBA
JohnnyDBA
Say Hey Kid
Say Hey Kid (708 reputation)Say Hey Kid (708 reputation)Say Hey Kid (708 reputation)Say Hey Kid (708 reputation)Say Hey Kid (708 reputation)Say Hey Kid (708 reputation)Say Hey Kid (708 reputation)Say Hey Kid (708 reputation)

Group: General Forum Members
Points: 708 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.

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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search