declare @day datetime 
declare @weekA datetime 
declare @weekB datetime
declare @monthA datetime
declare @monthB datetime  
SET @day= CONVERT(varchar(100), GETDATE(), 111) 
SET @weekA=(select DATEADD(day,-(DATEPART(weekday,@day)-1),@day) ) 
SET @weekB=(select DATEADD(day,-(DATEPART(weekday,@day)-5),@day) )  
SET @monthA=( select   DATEADD(dd,-day( @day )+1, @day))
Set @monthB=(select convert(char(7),getdate(),20)+'-25 00:00:00.000')  

 

posted on 2017-02-15 18:18  麦田守望  阅读(837)  评论(0编辑  收藏  举报