给定一个日期,确认是本月的第几周

select * from workplan
 where (select DATEPART(wk,w_time)-DATEPART(wk,DATEADD(dd,-day(w_time),w_time))+1 )='3' 
order by w_time desc

 

你可能感兴趣的:(SQLserver)