当天数据:
0点--当前时间 select * from tableName where datediff(day, 字段名,getdate())=0
昨天当前时间--今天当前时间 select * from tableName where datediff(HH, 字段名,getdate())<24
本周数据:select * from tableName where datediff(week, 字段名,getdate())=0
本月:select * from tableName where datediff(month, 字段名,getdate())=0
本季度:内select * from tableName where datediff(quarter, 字段名,getdate())=0
本年:select * from tableName where datediff(year, 字段名,getdate())=0