Iqbal
As of now your calculation is happening as per below
First Record
Start Date: 01.05.2016
End Date: 15.05.2016
Salary: 15000
=15000/31*15 = 7258
Second Record
Start Date: 16.05.2016
End Date: 31.05.2016
Salary: 18000
=18000/31*16 = 9290
Can you please let us know on what is the base calculation to get the amount 16616 as per your logic stated in the Query