I have two date columns; given_schedule and delivery_schedule. To query them, I use the following:
SELECT *
FROM table2
WHERE CONVERT(date, given_schedule) >= CONVERT(date, DATEADD(dd, -3, GETDATE()))
This SELECT returns all the rows within the last 3 days. What I need to do, though, is remove all of the returned rows which have today’s date in the delivery_schedule.
How should I update my query to do this? Essentially, I want to remove anything returned by the following query:
SELECT * FROM table2
WHERE CONVERT(date, delivery_schedule) = CONVERT(date, GETDATE())
1 Answer