I have
CustID Contract start contract ends
100 2013-09-30 2013-12-31
100 2014-02-28 2014-12-31
The calculation should give me the Gaps in days between contracts
I am trying to do the below which gives me the Contract duration:
SELECT CustID , StartDt , EndDt , FIRST_VALUE(DateDiff(DAY, StartDt, EndDt)) OVER (PARTITION BY CustID ORDER BY CustID
ROWS BETWEEN 0 PRECEDING AND 1 FOLLOWING) C
FROM tblContracts
However, I need the calculation between the end date of the last contract and the start date of the second contract
Any Suggestions would be really helpfull