I have a date range like
date from=2011-10-14 & date to=2011-10-20
if I have another date ranges
like
- 2011-10-11 - 2011-10-15
- 2011-10-11 - 2011-10-21
- 2011-10-15 - 2011-10-21
- 2011-10-15 - 2011-10-19
- 2011-10-21 - 2011-10-26
I want sql query which shows only the date range whose dates lies in between above (2011-10-14 & date to=2011-10-20) date range.
Here only 2011-10-21 - 2011-10-26 does not lies in date from=2011-10-14 & date to=2011-10-20
Result must show
- 2011-10-11 - 2011-10-15
- 2011-10-11 - 2011-10-21
- 2011-10-15 - 2011-10-21
- 2011-10-15 - 2011-10-19
these dates
Hope you understand what I am asking.
date_from < '2011-10-20' AND date_to > '2011-10-14'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With