Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
how to do emi calculation



for ex i have taken loan 50000

for 50000 i have to pay emi monthly 5000 for 10 months

start date is 1st Mar 2015
end date is 1st Dec 2015.

and i have inserted all these values in database those are
Name
TotalAmount
StartDate
EndDate
MonthlyPay

and i have binded these values to grid view also

my problem is , i want to show extra column in grid that is due amount ,when start date is crossed 1 month,show due amount is 5000 , and it crossed
2 months show 10000 and this so on for 10 months and then stop.


can you please suggest me how to do this, or give me any example for emi payment page,
if you want code i will attach
Posted
Comments
Suvendu Shekhar Giri 27-Oct-15 3:07am    
Please share the relevant code, if you have tried anything so far.

Such as functionality is called running sum[^]. Follow the link to get tons of examples.
 
Share this answer
 
Apart from the above answer, you can do it like below.
SQL
select Case StartDate 
          When 1 Then 1*MonthlyPay
          When 2 Then 2*MonthlyPay
          When 3 Then 3*MonthlyPay
          When 4 Then 4*MonthlyPay
       End
from tablename
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900