2013-07-22 41 views

回答

2

嘗試這一個 -

DECLARE @Data DATETIME 
SELECT @Data = GETDATE() 

SELECT * 
FROM TABLENAME 
WHERE text_date BETWEEN @Data AND DATEADD(MINUTE, 300, @Data) 
+0

感謝哥們! –

+0

不客氣@Vikas Hooda :) – Devart

3
DECLARE @AddTime DATETIME 
    SELECT @AddTime = GETDATE(); 

SELECT * 
    FROM TABLENAME 
WHERE text_date BETWEEN @AddTime AND DATEADD(HOUR, 5, @AddTime); 

Reference

相關問題