Our hotel booking table uses only StartDate and EndDate fields. Days between the two dates are booked.
My challenge is to find gaps of X consecutive days in a two-month period. In that timespan, there may be as few as 0 records, and as many as 10.
I do not have to identify all gaps X days long. One or none is sufficient, so long as one or none is true.
I've not been able to come up with a solution that executes in less than three minutes. Execute time has to be below 2 seconds.
We're using MS SQL Server 2000.