zoukankan      html  css  js  c++  java
  • 查询通话时间报表

    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

  • 相关阅读:
    PHP 小tip .(@)符号和 php if 赋值
    PHP定义字符串时单引号和双引号的区别
    笔记本 windows 10 安装
    unix_12c_db_init
    教你如何使用php session
    js和 php 介绍
    PHP 简单答题系统
    PHP list() 函数
    PHP集成支付宝快速实现充值功能
    eclipse如何导入PHP的项目
  • 原文地址:https://www.cnblogs.com/zhaojingwei/p/4554838.html
Copyright © 2011-2022 走看看