Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Time Ave in Report

Author  Topic 

nikoo56
Starting Member

26 Posts

Posted - 2012-03-14 : 19:08:14
I have this query that shows total response in time format hours:min
like 5:60
in the report I like to show Average for each team. I am not sure how to write an expression.

select ltrim((total_response)/60) +':' + REPLACE(
SPACE(CASE WHEN (total_response)%60< 10 THEN 1 ELSE 0 END), ' ', '0') + LTRIM((total_response)%60)
AS total_response

from view


Thanks,

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-03-15 : 15:58:34
[code]
select team,convert(varchar(8),dateadd(minute,avg(datediff(minute,0,total_response)*1.0),0),108)
from view
group by team
[/code]

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -