number between 0 and 24  ==>  替换成 number = n(某个时间段对应的值)

解决方案 »

  1.   

    你把datetime中的日期截取出来,然后加入到查询条件中。
      

  2.   

    要实现的是 例如:统计从2009-09-01 到2009-10-01 这段时间内 每天各个相同时段(1天24小时,分为24个时段)的进线总数 
    (每天1点的进线总数,每天2点的进线总数,每天23点的进线总数..)
    格式如下:
    时间        呼叫总量      。 
    00:00      20  
    01:00      34 
    ...... 
    23:00      344 
    24:00      200 之前写的那个SQL只能统计具体某一天的各个时段的进线数,不能统计某个时间段范围的各个时段进线数
      

  3.   


    cast(...*100 as varchar(10))+'%'
      

  4.   

    cast(cast((接听数*1.0/呼叫总数)*100 as decimal(6,0)) as varchar(10)) + '%' as 接听比例  OK ,各位帮忙看看这个贴:http://topic.csdn.net/u/20091120/09/933b75c2-66cd-484a-9cd3-4c77bcf056f5.html?32591
    100分
      

  5.   

    晕菜,怎么这么转换日期,好好看看sqlserver的日期时间函数,类似如下
    select hour_of(the_time),.....count(*)
    from table
    where date_of(the_time)=your_date
     group by hour_of(the_time)
    之类的就行了。只会db2的飘过