1、select * from sysLog where DateDiff(dd,creatDate,getdate())=0 //当天
2、SELECT * FROM sysLog where creatDate between dateadd(week, datediff(week,0,GETDATE()-1),0) and GETDATE() //本周,由于西方国家认为每周的周日是一周的第一天,所以按照中国人的习惯,应该修改成现在这种写法
3、SELECT * FROM sysLog WHERE datediff(month,[creatDate],getdate())=0 //本月
4、select * from sysLog where DATEPART(qq, creatDate) = DATEPART(qq, GETDATE()) and DATEPART(yy, creatDate) = DATEPART(yy, GETDATE()) //本季度
5、select *from sysLog where year(creatDate)=year(getdate()) //本年