-- "0"表示"1900-01-01"此日期正好为星期一 -- 当前月第一天 select DATEADD (mm, DATEDIFF (mm, 0 , GETDATE ()), 0 ) -- 本周星期一 select DATEADD (WK, DATEDIFF (WK, 0 , GETDATE ()), 0 ) -- 季度第一天 select DATEADD (QQ, DATEDIFF (QQ, 0 , GETDATE ()), 0 ) -- 本年第一天 select DATEADD (YY, DATEDIFF (YY, 0 , GETDATE ()), 0 ) -- 当天凌晨 select DATEADD (DD, DATEDIFF (DD, 0 , GETDATE ()), 0 ) -- 上月最后一天 select DATEADD (MS, - 3 , dateadd (mm, DATEDIFF (mm, 0 , GETDATE ()), 0 )) -- 去年最后一天 select DATEADD (MS, - 3 , dateadd (YY, DATEDIFF (YY, 0 , GETDATE ()), 0 )) -- 本月最后一天 select DATEADD (MS, - 3 , dateadd (mm, DATEDIFF (mm, 0 , GETDATE ()) + 1 , 0 )) -- 本年最后一天 select DATEADD (MS, - 3 , dateadd (yy, DATEDIFF (yy, 0 , GETDATE ()) + 1 , 0 )) -- 本月的第一个星期一 select DATEADD (wk, DATEDIFF (wk, 0 , dateadd (dd, 6 - datepart ( day , getdate ()), getdate ())), 0 ) -- 获取当前的天数 select datepart (D, getdate ()) -- 找到本月的6号,因为6号正好可以排到星期六(本周最后一天,星期天为某周第一天) select dateadd (dd, 6 - datepart ( day , getdate ()), getdate ()) -- 获取相差的周数 select DATEDIFF (wk, 0 , dateadd (dd, 6 - datepart ( day , getdate ()), getdate ()))