SSRS sum of time
I have fields which has time i want total of the time 0:00:58 0:18:39 0:04:55 0:25:50 0:50:32 0:50:47 0:11:28 0:22:56 3:06:05 I tried to use sum(formatdatetime(datefield,"hh:mm:ss") got error when i use that. How do we sum time in SSRS.
February 24th, 2010 1:40pm

What I did, when I had similar requirement:Get time in seconds or minutes from sourceSUM on reporting sideConvert to HH:MM while displaying.Please vote for answer if it helps you.
Free Windows Admin Tool Kit Click here and download it now
February 24th, 2010 2:01pm

work around create the following custome code:Function HrsMinSec(ByVal Seconds as Double) as String Dim sReturn as String Dim iHrs as Integer Dim iMin as Integer Dim iSec as Integer Dim iSeconds as Integer iSeconds = Int(Seconds) iHrs = Int(iSeconds/3600) iMin = Int((iSeconds - (iHrs*3600))/60) iSec = iSeconds - (iHrs*3600) - (iMin*60) sReturn = CStr(iHrs) & ":" sReturn = sReturn & Right("0" & CStr(iMin),2) & ":" sReturn = sReturn & Right("0" & CStr(iSec),2) HrsMinSec = sReturn End Function =Code.HrsMinSec(sum(datediff( "s",date1,date2)))
February 24th, 2010 2:20pm

This is great!! Thank you so much!!
Free Windows Admin Tool Kit Click here and download it now
January 24th, 2011 4:08pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics