ASP.NET查询本月 本周 本季

时间:2013-09-19 04:37:16
【文件属性】:
文件名称:ASP.NET查询本月 本周 本季
文件大小:489B
文件格式:TXT
更新时间:2013-09-19 04:37:16
ASP.NET查询 查询本月的记录 select * from tableName where DATEPART(mm, theDate) = DATEPART(mm, GETDATE()) and DATEPART(yy, theDate) = DATEPART(yy, GETDATE()) 查询本周的记录 select * from tableName where DATEPART(wk, theDate) = DATEPART(wk, GETDATE()) and DATEPART(yy, theDate) = DATEPART(yy, GETDATE()) 查询本季的记录 select * from tableName where DATEPART(qq, theDate) = DATEPART(qq, GETDATE()) and DATEPART(yy, theDate) = DATEPART(yy, GETDATE()) 其中:GETDATE()是获得系统时间的函数。

网友评论