Arun Rana
Arun Rana

Reputation: 8606

Filter result of sql procedure against current datetime

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.

Upvotes: 0

Views: 53

Answers (1)

bjnr
bjnr

Reputation: 3437

DECLARE @date as DATETIME = GETDATE()

SELECT RowId, Sid, NextScheduleTime
FROM yourTable
WHERE NextScheduleTime BETWEEN @date AND DATEADD(mi, 1, @date)

Upvotes: 1

Related Questions