首页 > 开发 > 综合 > 正文

查询通话时间报表

2024-07-21 02:46:48
字体:
来源:转载
供稿:网友
查询通话时间报表

select AckBegin , count(*) as incallcount,CallType, convert(varchar(10),sum(datediff(s,callbegin,callend))/3600)+':'+convert(varchar(10),sum(datediff(s,callbegin,callend))%3600/60)+':'+convert(varchar(10),sum(datediff(s,callbegin,callend))%3600%60) as Calltime from TB_CallRecord where AckBegin between '2015-6-1' and '2015-6-5' group by CallType,AckBegin select AckBegin,COUNT(*) as incallcount, YEAR(WaitBegin) as nian,calltype,convert(varchar(10),sum(datediff(s,callbegin,callend))/3600)+':'+convert(varchar(10),sum(datediff(s,callbegin,callend))%3600/60)+':'+convert(varchar(10),sum(datediff(s,callbegin,callend))%3600%60) as Calltime from TB_CallRecord where AckBegin between '2015-6-1' and '2015-6-5' group by CallType,WaitBegin,AckBegin select COUNT(*) as incallcount,calltype, cast(year(cast (WaitBegin as datetime)) as varchar(4))+'-'+ cast( month(cast (WaitBegin as datetime)) as varchar(2)) as yue, convert(varchar(10),sum(datediff(s,callbegin,callend))/3600)+':'+convert(varchar(10),sum(datediff(s,callbegin,callend))%3600/60)+':'+convert(varchar(10),sum(datediff(s,callbegin,callend))%3600%60) as Calltime from TB_CallRecord group by CallType,WaitBegin order by CallType select count(*) as incallcount,calltype,cast(year(cast (WaitBegin as datetime)) as varchar(4))+'-'+ cast( month(cast (WaitBegin as datetime)) as varchar(2))+'-'+cast(day(cast (WaitBegin as datetime)) as varchar(2)) as ri, convert(varchar(10),sum(datediff(s,callbegin,callend))/3600)+':'+convert(varchar(10),sum(datediff(s,callbegin,callend))%3600/60)+':'+convert(varchar(10),sum(datediff(s,callbegin,callend))%3600%60) as Calltime from TB_CallRecord group by CallType,WaitBegin order by CallType


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表