The short version;
In short, given one date range (start and end dates) how can I find the
period that overlaps with another date range?
The long version;
I have knocked up a little application that helps my friend monitor employee
absences.
You can enter the start and end dates of an absence. For reports the user
specifies start and end dates which produces a list of people with absences
in that period. Only problem is if someone's absence overlaps into the
report period.
e.g report covers March 1st to April 1st but won't include an absence that
started on Jan 1st and finished on March 20th. In that case I need to pick
up that overlapping absence which would be March 1st to March 20th.
Looking at it now I can't understand how I missed something so obvious but I
can't work out how to revise my queries.
Any suggestions?