I am trying to find all the lease that does not fall in the rental period. The structure of my tables are as follows:
Unit Availability table:
Unit Key Start Date End Date Availability 1 1/1/2015 6/1/2015 1 1 6/2/2015 12/31/2015 0 1 1/1/2016 12/31/2016 1 2 1/1/2015 6/1/2015 1 2 6/2/2015 12/31/2015 0
Lease table:
Unit Key Lease Start Lease End 1 1/1/2015 6/1/2015 1 7/2/2015 8/2/2015
I am looking to write a logic to determine all the lease that does not fall in the availability period. In this case, the 2nd row in the lease table should be the output.
Any kind of help or lead will be much appreciated.