I have a query with a begin and end date parameter. However, I find I also need to select people who have time in a house that overlaps from one month to the next. They don't show because of the end date.
Example: Parameters - 01/01/2013 to 01/31/2013
Person1 - At a facility during the month
Person2 - At a facility 01/25/2013 to 02/05/2013
Person3 - At a facility 12/28/2012 to 01/04/2013
Person1 will show up, person2 won't because the end date isn't <= @enddate
Person3 won't show because of the begindate.
I also calculate how many days and hours they are at a facility. I want to capture the overlap people and only show the days and hours for the time during the begin and end dates. I've attached the part of my code with the calculations and selections.