I have a SQL Server database with a Date column. These dates are all future dates.
How would I go about finding all approaching dates within a 2 week time period? Basically a two week notice query on upcoming dates.
For example: Today is August 2nd. The query would return, if any, dates that were August 16th (2 weeks ahead).
And if it was run tomorrow it would return August 16th and August 17th (2 weeks ahead).
This would obviously be run everyday via a reporting manager (SSRS). Any ideas?
Thanks.
You can use DATEADD:
If your column is
datetime, you may want to convert it to be a date first, otherwise running this at 12:00 on Aug 1st would return everything upto 12:00 on Aug 15th. The following code will do this for you: