0

I have one procedure called GetScheduleWithNextRunTime which will result datetime values where schedule need to run next as below

enter image description here

Now I would like to filter this result against current date to get records which nextscheduletime within minute.

Arun Rana
  • 8,426
  • 14
  • 67
  • 107
  • If you can't alter your Stored Procedure, you will have to get the result of your Stored Procedure into a (temporary) table, in order to filter it. Try searching here on Stack Overflow on how to do that, or click here for the answer: http://stackoverflow.com/questions/653714/how-to-select-into-temp-table-from-stored-procedure – Dan Dec 13 '13 at 13:11
  • I don't understand the question. – Dan Bracuk Dec 13 '13 at 13:13

1 Answers1

1
DECLARE @date as DATETIME = GETDATE()

SELECT RowId, Sid, NextScheduleTime
FROM yourTable
WHERE NextScheduleTime BETWEEN @date AND DATEADD(mi, 1, @date)
bjnr
  • 3,353
  • 1
  • 18
  • 32