I have a problem with calculating average time. This is the case: i have multiple rows, in each row there is data in time format so I need to calculate an average time of al
You should be able to use something similar to the following:
select
cast(cast(avg(cast(CAST(times as datetime) as float)) as datetime) as time) AvgTime,
cast(cast(sum(cast(CAST(times as datetime) as float)) as datetime) as time) TotalTime
from yourtable;
See SQL Fiddle with Demo.
This converts the times data to a datetime, then a float so you can get the avg/sum, then you convert the value back to a datetime and finally a time