首先得到表数据【计算资金占用】,然后再计算。不就是很简单的事?循环每一行,根据规则,计算这个式子即可
【143,369.66 * (-60)* 利率 + 215,054.5 * 30 * 利率 + 215,054.5 * 210 *利率】
Dim id As Integer = 1Dim ll As Double = 0.002 '利率Dim dt As DataTable = DataTables("计算资金占用")Dim sum As Double = 0For Each dr As DataRow In dt.Select("付款编号 = '" & id & "'", "付款日期") sum = sum + dr("付款金额") * dr("占用天数") * llNextmsgbox(sum)