datediff(week,zy_time,getdate())=0 //查詢本周 datediff(month,zy_time,getdate())=0 //查詢本月 本季:select * from table where datediff(qq,C_CALLTIME,getdate ...
本文主要向大家介紹了SQLServer數據庫之SQL Server 獲取本周,本月,本年等時間內記錄,通過具體的內容向大家展現,希望對大家學習SQLServer數據庫有所幫助。 datediff week,zy time,getdate 查詢本周datediff month,zy time,getdate 查詢本月本季:select fromtablewheredatediff qq,C CALL ...
2019-11-06 23:15 0 817 推薦指數:
datediff(week,zy_time,getdate())=0 //查詢本周 datediff(month,zy_time,getdate())=0 //查詢本月 本季:select * from table where datediff(qq,C_CALLTIME,getdate ...
datediff(week,zy_time,getdate())=0 //查詢本周 datediff(month,zy_time,getdate())=0 //查詢本月 本季:select * from table where datediff(qq,C_CALLTIME,getdate ...
本周:select * from table where datediff(week,C_CALLTIME,getdate())=0 --C_CALLTIME 為日期字段本月:select * from table where datediff(Month,C_CALLTIME ...
參數聲明 1、查詢本日開始、結束時間 2、查詢本周開始、結束時間 3、查詢本月開始時間、結束時間 4、查詢本季度開始、結束時間 5、查詢本年度開始時間、結束時間 ...
我把我CSDN寫的 搬來博客園了。。 SELECT * FROM 表名 WHERE timestampdiff( ...
如我要取8月1號到8月30號之間的早上7點半到晚上八點半這段時間內的數據。 SELECT * FROM tableName AS tWHERE t.create_date BETWEEN '2017-08-01 07:30' AND '2017-08-30 20:30 ...