SQL 查询当天,本月,本周的记录
摘要:
SELECT * FROM 表 WHERE CONVERT(Nvarchar, dateandtime, 111) = CONVERT(Nvarchar, GETDATE(), 111) ORDER BY dateandtime DESC本月记录SELECT * FROM 表 WHERE datediff(month,[dateadd],getdate())=0本周记录SELECT * FROM 表 WHERE datediff(week,[dateadd],getdate())=0当天记录SELECT * FROM 表 WHERE datediff(day,[dateadd],getdate 阅读全文
posted @ 2011-08-26 11:46 jehn 阅读(132) 评论(0) 推荐(0) 编辑