Groups | Blog | Home
all groups > sql server reporting services > december 2005 >

sql server reporting services : Time formattine for graphs


William
12/22/2005 8:20:04 AM
I have a datetime field being graphed by hour. The data is
datepart("h",datetimefield.value) and the x-axis uses format("t") for labels.
My problem is that I have labels like 11:01 AM and 2:07 PM instead of 1:00
PM, 2:00 PM, 3:00 PM, etc.

How do I accomplish getting an exact hour label?
Somehow I want to format the datepart("h",datetimefield.value).
I tried =Format(datepart("h",Fields!Call_Start_Time.Value),"t") , but all I
got were a constant label of "t".

Any help would be appreciated. Thanks.

Chris
2/20/2006 11:11:43 AM
I suspect the problem is to do with the fact you are returning an
integer value with the datepart and then trying to convert it to a time
value. Maybe try subtracting minutes and seconds from the time, then it
stays a datetime data type, for instance;
=DateAdd("s", -DatePart("s", time.value), DateAdd("mn", -DatePart("mn",
time.value), time.value))

Cheers
Chris


[quoted text, click to view]



--
AddThis Social Bookmark Button