I want to insert dates in my (SQLLite) database (format: yyyyMMdd). This dates shouldn't overlap the same time.
I tried to use this:
SELECT COUNT(*) FROM termine WHERE string = "" AND ((startDay BETWEEN 20151007 AND 20151009) OR (endDay BETWEEN 20151007 AND 20151009))
Problem: If the database contains values like startDay = 20151006 and endDay = 20151010, my method won't work, because the dates are not between the others.
So, what is the easiest way to check if a date is in the range of another?