1
我有這樣的查詢:的SQL Server:日期調整問題
SELECT 'Last 7 Days' AS Date_Range, CONVERT(smalldatetime, GETDATE()) - 6 AS Begin_Date, CONVERT(smalldatetime, GETDATE())
AS End_Date
FROM sys.columns
產生輸出
Last 7 Days 2011-03-20 07:35:00 2011-03-26 07:35:00
Last 7 Days 2011-03-20 07:35:00 2011-03-26 07:35:00
如何獲得呢?
Last 7 Days 2011-03-20 00:00:00 2011-03-26 00:00:00
Last 7 Days 2011-03-20 00:00:00 2011-03-26 00:00:00