I have a table with contract information and I would like to add a calculated column that identifies when a contract is consecutive to the previous one of the same client. So when the end date of a contract matches the start date of the following one for the same client we consider that is consecutive.
The data looks like this:
And I would like it to look like this:
I tried doing an inner join of the contract table with itself and then I unioned it, but I don't think that is the most effective way of doing it.
Do you know of a better way of achieving this?
Thanks in advance.

