sql统计上周销售量的起止时间
开始日期:
>
select DATEADD(Day, 1 - DATEPART(Weekday,CONVERT(varchar(10), GETDATE() - 7, 120)), CONVERT(varchar(10), GETDATE()- 7, 120))
结束日期
<=
select DATEADD(Day, 1 - DATEPART(Weekday,CONVERT(varchar(10), GETDATE() - 7, 120)), CONVERT(varchar(10), GETDATE(), 120))