//Find records for the last 2 days
SELECT * FROM tableName
WHERE LogDateTime >= DATEADD (DD, -2, GETDATE());
//Find records for the last 2 hours
SELECT * FROM tableName
WHERE LogDateTime >= DATEADD (HOUR, -2, GETDATE());
SELECT * FROM tableName
WHERE LogDateTime >= DATEADD (DD, -2, GETDATE());
//Find records for the last 2 hours
SELECT * FROM tableName
WHERE LogDateTime >= DATEADD (HOUR, -2, GETDATE());
No comments:
Post a Comment