---查上周记录 select * from 你的表 where 你的日期字段 between dateadd(d,-7,getdate()) and getdate() --查上月记录 select * from 你的表 where convert(varchar(4),year(你的日期字段))+convert(varchar(2),month(你的日期字段))= convert(varchar(4),year(getdate()))+convert(varchar(2),month(getdate()))
温馨提示:答案为网友推荐,仅供参考