Return next upcoming dates from current date
I am trying to return the upcoming rows in my query, so I have output like this
2020-11-25 08:00:00.000
2020-11-25 09:00:00.000
2020-11-25 10:00:00.000
2020-11-25 12:00:00.000
2020-11-25 14:00:00.000
2020-11-26 08:00:00.000
2020-11-26 10:00:00.000
2020-11-26 12:00:00.000
2020-11-26 14:00:00.000
2020-11-27 08:00:00.000
2020-11-27 10:00:00.000
2020-11-27 12:00:00.000
2020-11-30 08:00:00.000
2020-11-30 10:00:00.000
2020-11-30 12:00:00.000
And I want to return just the closet rows from the current date, so I want it to only output as
2020-11-25 08:00:00.000
2020-11-25 09:00:00.000
2020-11-25 10:00:00.000
2020-11-25 12:00:00.000
2020-11-25 14:00:00.000
And then when it the query executes tomorrow, return just
2020-11-26 08:00:00.000
2020-11-26 10:00:00.000
2020-11-26 12:00:00.000
2020-11-26 14:00:00.000
How do I have my query return the nearest date from current date at time of execution?
I have searched lots and lots of posts but can't seem to find it.
from Recent Questions - Stack Overflow https://ift.tt/2UXs22f
https://ift.tt/eA8V8J
Comments
Post a Comment