Get records 10 min before system datetime in SQL

后端 未结 4 1652
长情又很酷
长情又很酷 2020-12-16 11:48

i need to find the records 10 min before system current datetime.

select Id,TimeStamp from ISAlive where RecordUpdatedDate < GETDATE() --SYSDATETIME()
         


        
4条回答
  •  攒了一身酷
    2020-12-16 12:16

    SELECT Id, TimeStamp
    FROM ISAlive 
    WHERE RecordUpdatedDate < DATEADD(minute,-10, SYSDATETIME());
    

提交回复
热议问题