你可以先得到这个日期
算出第一周的时间范围
date1-begin       date1-end
第二周
date2-begin       date2-end
...
select count(日期)as 次数 , 服务类型  from table group by 服务类型
where 日期>date1-begin and 日期 < date1-end
union
select count(日期)as 次数 , 服务类型  from table group by 服务类型
where 日期>date2-begin and 日期 < date2-end
union
...

解决方案 »

  1.   

    select sum(汇总项目1),sum(汇总项目2),datepart(ww,日期字段名) from 表 where begindate>=起始时间 group by datepart(ww,日期字段名) 你试试看
      

  2.   

    datepart(ww,日期字段名) 就是你要的每个周,放在group by 后面可以按周分组汇总,汇总项目换成“约访”,“面谈”“送建议书”...
    我的msn是   [email protected]
      

  3.   

    datediff(day,stime,getdate())很好用.(SQL)