1. 查詢當日、昨日、本周、本月、本季度、本年數據 2. 獲取其他日期數據 查詢結果: 3. 日期函數: 函數 功能 Convert(data_type ...
1.今天 2.昨天 3.本周 4.上周 5.近7天 6.近30天 7.本月 8.上月 9.近6個月 10.本季度 11.上季度 ...
(); }; /*** * 獲得本周起止時間 */ this. ...
前提條件:假設表名為:tableName;時間字段名為:theDate ①查詢本周的記錄 select * from tableName where DATEPART(wk, theDate) = DATEPART(wk, GETDATE()) and DATEPART(yy ...
1.今天 2.昨天 3.本周 4.上周 5.近7天 6.近30天 7.本月 8.上月 9.近6個月 ...
當天數據:select * from tableName where datediff(day, 字段名,getdate())=0 本周數據:select * from tableName where datediff(week, 字段名,getdate())=0 本月:select ...
1.今天 2.昨天 3.本周 4.上周 5.近7天 6.近30天 7.本月 8.上月 9.近6個月 10.本季度 ...