--按日
select sum(field1),day([date]) from table1 where year([date]) = '2006' group by day([date])
--按周
select sum(field1),datename(week,[date]) from table1 where year([date]) = '2006' group by datename(week,[date])
--按月
select sum(field1),month([date]) from table1 where year([date]) = '2006' group by month([date])
--按季
select sum(field1),datename(quarter,[date]) from table1 where year([date]) = '2006' group by datename(quarter,[date])
时间跨度大的,按照年、季度、月依次分组