I posted on this before and thought I was in a good spot -My sql to date is -SELECT t1.contract_id, t1.effective_start_date, 1.effective_end_date, t2.effective_start_date, t2.effective_end_dateFROM Dim_Contract AS t1 INNER JOIN Dim_Contract AS t2 ON (t1.effective_end_date<>t2.effective_start_date) AND (t1.effective_start_date<>t2.effective_start_date) AND (t2.effective_start_date between t1.effective_start_date and t1.effective_start_date or t2.effective_end_date between t1.effective_start_date and t1.effective_end_date) AND (t1.contract_id=t2.contract_id);
Which seems to work fine when start dates and end dates are overlapping but it seems to miss entries like the follow -CONTRACT_ID EFFECTIVE_START_DATE EFFECTIVE_END_DATEP01811 7/1/2008 6/30/2009P01811 7/1/2008 4/30/2009Can anyone help tweak my sql so that I cover all possible date overlapping scenerios? Basically within a contract every entry for dates cannot overlap with another. So in the example that failed that entry cannot happen.