-1

How can I substract the column "begin_execution" with 5 minutes? The begin_execution-Datetime will filled via an SQL-Task, but i need this time -5 minutes to check the running compatibility.

Example:

SELECT * FROM queue_entry WHERE begin_execution - GETDATE()-5min AND STATUS = 'not solved'

Thats the original output:

2016-06-09 15:00:11.4070000

i need this output (-5 minutes):

2016-06-09 14:55:11.4070000

Mick
  • 67
  • 6

1 Answers1

2
WHERE begin_execution >= DATEADD(MINUTE, -5, GETDATE())
Squirrel
  • 23,507
  • 4
  • 34
  • 32
  • More info can be found here: https://msdn.microsoft.com/en-us/library/ms186819.aspx – Jens Jun 09 '16 at 13:24