We have a Table with few Thousands of rows. We are looking to find if there is any overlapping dates for each ID. Here is a example of data.
ID From Date To Date
51416 2008-11-14 00:00:00.000 2009-06-01 00:00:00.000
51416 2006-04-15 00:00:00.000 2008-11-14 00:00:00.000
51416 2006-02-11 00:00:00.000 2006-04-15 00:00:00.000
51416 2005-05-25 00:00:00.000 2006-02-15 00:00:00.000
If take a look at the last 2 records, The From date is 2006-02-11, where as the previous record has End date as 2006-02-15. In this case the starting date should be 2006-02-15 or later, but should not overlap with previous End date. There should be continuation of dates. If Gaps are there thats fine too.
We are looking to disply those records have Opver Lapping Records.