garyinmiami2003
asked on
combining rows with dates across multiple rows - A SQL question
I'm having trouble combining rows with dates across more than one rows with no breaks
in time:
Example:
TableA
Key eff_dt term_dt
1234 02/01/2012 03/01/2012
1234 03/02/2012 12/31/9999
Result set should be:
1234 02/01/2012 12/31/9999
If this situation:
5678 02/01/2012 03/01/2012
5678 03/03/2012 12/31/9999
Since there is a one day not covered both rows (03/02/2012 not included) would be in the result set.
in time:
Example:
TableA
Key eff_dt term_dt
1234 02/01/2012 03/01/2012
1234 03/02/2012 12/31/9999
Result set should be:
1234 02/01/2012 12/31/9999
If this situation:
5678 02/01/2012 03/01/2012
5678 03/03/2012 12/31/9999
Since there is a one day not covered both rows (03/02/2012 not included) would be in the result set.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.