My SP runs once an hour by a SQL job is selecting from the database a number of records that have a field with a date that is not older than 5 days, yet older by a variable passed in.
The problem is, my logic only names it by DAY, and not fine-tuned to the HOUR at least.
How can I change this to have it filter to the hour or better to the second?
The problem is, my logic only names it by DAY, and not fine-tuned to the HOUR at least.
Code:
WHERE Active = 'T' AND (DateModified BETWEEN (GETDATE()-5) AND (GETDATE()-@AlertDays))
How can I change this to have it filter to the hour or better to the second?