ID EmployeeID Status EffectiveDate
1 110545 Active 01-01-2011
2 110700 Active 05-01-2012
3 110060 Active 05-01-2012
4 110222 Active 30-06-2012
5 110222 Resigned 22-05-2016
6 110545 Resigned 01-07-2012
7 110545 Active 12-02-2013
How would it be possible using T-SQL to find the amount of time that has passed between when the status as "Active" and "inactive" for each employee excluding current status as "Active" for Re-joined employee.
Output should
ID EmployeeID Days
1 110222 1422
2 110545 371