I need to check if two dates over lap with another two dates in my database.
My database looks like this
+----+--------------+------------+------------+
This is just the where clause. Given InputStartDate and InputEndDate are given by user input, and DataStartDate and DataEndDate are the datetime values in the table:
where ((DataEndDate > InputStartDate) and (DataStartDate < InputEndDate))