--创建开始日期临时变量
declare @StartDate date
--创建结束日期临时变量
declare @EndDate date
set @StartDate='2017-3-5'
set @EndDate='2017-3-11'
select [Date] as [日期],SUM(Shuzhi) as [和],max(Shuzhi) as [最大值] from 表名
--查询条件,开始日期和结束日期选择7天只差
where [Date] between @StartDate and @EndDate
--通过日期字段分组聚合
group by [Date]