reporting services - SSRS Data Type Conversion issue | Tough one -
i have been working on ssrs project , ran several issues. trying move averages , team averages on integers , convert string.
please see picture below. getting weird results. issue when go on 60 minutes, not 01:01:00 61:00. have tried public functions such :
public function minstohhmm (byval minutes as decimal) dim hourstring = floor(minutes/60).tostring() dim minstring = floor(minutes mod 60).tostring() return hourstring.padleft(2, "0") & ":" & minstring.padleft(2, "0") end function =code.minstohhmm(avg(fields!test.duration.value))
i not getting right conversion. trying hh : mm : ss format.
anybody knows how modify code result want?
thanks lot!
lukas
i think don't need use custom code that, if field containing minutes information set aggregable data type can calculate average in ssrs , format hh:mm:ss
follows:
=format( dateadd(dateinterval.minute,avg(fields!minutes.value),cdate("00:00:00")), "hh:mm:ss" )
let me know if helps.
Comments
Post a Comment