I have a MySQL table similar to this:
item | order | start date | end date ------------------------------------------ 1 1 2015-09-15 2015-09-20 2 1 2015-09-15 2015-09-20 1 2 2015-09-20 2015-09-25 2 2 2015-09-20 2015-09-25 What I want to do is execute a query that will check if any end-dates are within 7 days of a future start date, and return the result. Does anyone know how this could be done?
EDIT: Should be more specific I suppose - the start date and end date of an order (say in this case order 2 from the example table) can be within 7 days of each other. I want to check if order 1's end date is within 7 days of order 2's start date. Sorry if that wasn't clear before.