SQL SERVER recursive CTE for Leave Accrual projections
I have a table (Empl_Leave) with EMP ID, Current Leave balance, Leavetype ID, Hiredate, Last_Accrual_Date. And in another table(Leave_policy) i have Leavecode ID, Leave_Rate_Per_Every_Accrural, Months_Until_Range, Annual_Max_Carryover, and they look like this
Leave_policy