I have two variables containing dates. DateStart and DateEnd (in SQL).
I also have two DatePicker (in WinForm).
I am importing two dates from a database and you need to do something complicated.
Thus, two variables create a date range, and two date pickers create a different date range.
How can I check if these date ranges overlap with an Sql request?
For example, (format yyyy / mm / dd)
DateStart = 2012/07/01 , DateEnd = 2012/07/31
| DatePicker1 | DatePicker2 | Overlapping | -------------------------------------------- | 2012/07/15 | 2012/07/16 | True | -------------------------------------------- | 2012/07/31 | 2012/08/01 | True | -------------------------------------------- | 2012/06/20 | 2012/07/01 | True | -------------------------------------------- | 2012/08/01 | 2012/09/01 | False | --------------------------------------------
I know this got a little messed up, but I didn't know how else to ask about it.
source share