select day(dateadd(ms,-3,DATEADD(m, DATEDIFF(m,0,getdate())+1,0)))
---当月第一天select dateadd(d,-day(getdate())+1,getdate()) ---当月最后一天select dateadd(d,-day(getdate()),dateadd(m,1,getdate()))--本年最后一天select dateadd(d,-day(getdate()),dateadd(m,12,getdate()))--当月第一个星期一SELECT DATEADD(wk, DATEDIFF(wk, '', DATEADD(dd, 6 - DAY(getdate()), getdate())), '')