Sql 零秒的服务器 gettime()
Sql server gettime() with zero second
如何 SELECT GetDate() 零秒示例:getdate() 值 2017-09-19 09:35:51.340
但我需要 select 2017-09-19 00:00:00.000
?
SELECT CONVERT(datetime, CONVERT(date, GETDATE()))
DECLARE @date DATE= GETDATE();
SELECT CAST(@date AS DATETIME);
或
SELECT CONVERT(DATETIME, CONVERT(DATE, GETDATE()));
如何 SELECT GetDate() 零秒示例:getdate() 值 2017-09-19 09:35:51.340
但我需要 select 2017-09-19 00:00:00.000
?
SELECT CONVERT(datetime, CONVERT(date, GETDATE()))
DECLARE @date DATE= GETDATE();
SELECT CAST(@date AS DATETIME);
或
SELECT CONVERT(DATETIME, CONVERT(DATE, GETDATE()));