如何根据日期在网格视图中进行计算 [英] How to do calculations in grid view based on date
问题描述
如何做emi计算
ex ex我已经贷款50000 >
$ 500 $ b 50000我必须支付emi每月5000美元10个月
开始日期是2015年3月1日
结束日期是2015年12月1日。
我已将所有这些值插入数据库中
名称
TotalAmount
StartDate
EndDate
MonthlyPay
并且我已经将这些值绑定到网格视图中
我的问题是,我想在网格中显示额外的列到期金额,当开始日期超过1个月时,显示到期金额是5000,它越过
2个月显示10000,这样等10个月然后停止。
你能建议我怎么做,或者给我任何关于emi支付页面的例子,
如果你想要代码我会附上
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
推荐答案
等功能称为运行总和 [ ^ ]。按照链接获取大量示例。
Such as functionality is called running sum[^]. Follow the link to get tons of examples.
除了上面的答案,你可以像下面这样做。
Apart from the above answer, you can do it like below.
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
这篇关于如何根据日期在网格视图中进行计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!