I have two tables
Table 01
========
**ApprovedLeave**
UserName varchar
DateFrom varchar
DateTo varchar
NumofWorkingDays int
LeaveType varchar
Dept varchar
LStatus1 int
LStatus2 int
Table02
=======
**LeaveEntitlement**
UserName varchar
TotalLeaveRemaining int
I need to get the NumofWorkingDays int value and subtract it from TotalLeaveRemaining value in Table 02 and save it in the same Location. Please help. This is my code so far.
select (A.TotalLeaveRemaining-B.NumofWorkingDays)
from LeaveEntitlement as A join
ApprovedLeave as B
on A.UserName= B.UserName