SELECT *
FROM TABLENAME
WHERE
text_date < GETDATE()
AND
text_date < DATEADD(MINUTE, 300, GETDATE())
这有什么问题吗?
SELECT *
FROM TABLENAME
WHERE
text_date < GETDATE()
AND
text_date < DATEADD(MINUTE, 300, GETDATE())
这有什么问题吗?
DECLARE @AddTime DATETIME
SELECT @AddTime = GETDATE();
SELECT *
FROM TABLENAME
WHERE text_date BETWEEN @AddTime AND DATEADD(HOUR, 5, @AddTime );
试试这个——
DECLARE @Data DATETIME
SELECT @Data = GETDATE()
SELECT *
FROM TABLENAME
WHERE text_date BETWEEN @Data AND DATEADD(MINUTE, 300, @Data)