小记存储过程中经常用到的本周,本月,本年函数

1Dateadd(wk,datediff(wk,0,getdate()),-1)                              
2Dateadd(wk,datediff(wk,0,getdate()),6
3
4Dateadd(mm,datediff(mm,0,getdate()),0
5Dateadd(ms,-3,dateadd(mm,datediff(m,0,getdate())+1,0))
6
7Dateadd(yy,datediff(yy,0,getdate()),0)
8Dateadd(ms,-3,DATEADD(yy, DATEDIFF(yy,0,getdate())+10))