Dim nf As WinForm.ComboBox = e.Form.Controls("年份选择")
Dim yf As WinForm.ComboBox = e.Form.Controls("月份选择")
Dim y As Integer = cint(nf.Text)
Dim m As Integer = cint(yf.Text)
Dim dt0 As new Date(y-1,12,31)
Dim dt1 As New Date(y, 1, 1)
Dim dt2 As new Date(y, m, 1)
Dim dt3 As New Date(y, m, Date.DaysInMonth(y,m)) '获取该月的最后一天
For Each R1 As Row In Tables("基建及工程项目备案表").Rows
Dim babh As String = R1("备案编号")
r1("hts1") = iif(r1("备案日期")<=dt0,1,0)
r1("hts2") = iif(r1("备案日期")>=dt1 And r1("备案日期")<dt2,1,0)
r1("hts3") = iif(r1("备案日期")>=dt2 And r1("备案日期")<=dt3,1,0)
r1("hts4") = iif(r1("备案日期")>=dt1 And r1("备案日期")<=dt3,1,0)
r1("htjk1") = iif(r1("备案日期")<=dt0,r1("合同价款")/10000,0)
r1("htjk2") = iif(r1("备案日期")>=dt1 And r1("备案日期")<dt2,r1("合同价款")/10000,0)
r1("htjk3") = iif(r1("备案日期")>=dt2 And r1("备案日期")<=dt3,r1("合同价款")/10000,0)
r1("htjk4") = iif(r1("备案日期")>=dt1 And r1("备案日期")<=dt3,r1("合同价款")/10000,0)
If r1("评审报告日期") < r1("备案日期")
r1("评审报告日期1") = r1("备案日期")
Else
r1("评审报告日期1") = r1("评审报告日期")
End If
If r1("备案日期") <= dt3
If r1("备案日期") <= dt0
'If r1("最终定价") Is Nothing
' r1("yfk1") = r1("合同价款")/10000
' r1("yfk2") = r1("合同价款")/10000
' r1("yfk3") = 0
' r1("yfk4") = 0
' r1("yfk5") = r1("合同价款")/10000
' End If
If r1("最终定价") IsNot Nothing
If r1("评审报告日期1") <= dt0
r1("yfk1") = r1("最终定价")/10000
r1("yfk2") = r1("最终定价")/10000
r1("yfk3") = 0
r1("yfk4") = 0
r1("yfk5") = r1("最终定价")/10000
End If
If r1("评审报告日期1") >= dt1 And r1("评审报告日期1") < dt2
r1("yfk1") = r1("合同价款")/10000
r1("yfk2") = r1("最终定价")/10000
r1("yfk3") = 0
r1("yfk4") = r1("最终定价")/10000 - r1("合同价款")/10000
r1("yfk5") = r1("最终定价")/10000
End If
If r1("评审报告日期1") >= dt2 And r1("评审报告日期1") <= dt3
r1("yfk1") = r1("合同价款")/10000
r1("yfk2") = r1("合同价款")/10000
r1("yfk3") = r1("最终定价")/10000 - r1("合同价款")/10000
r1("yfk4") = r1("最终定价")/10000 - r1("合同价款")/10000
r1("yfk5") = r1("最终定价")/10000
End If
If r1("评审报告日期1") > dt3
r1("yfk1") = r1("合同价款")/10000
r1("yfk2") = r1("合同价款")/10000
r1("yfk3") = 0
r1("yfk4") = 0
r1("yfk5") = r1("合同价款")/10000
End If
End If
Else
'If r1("最终定价") Is Nothing
r1("yfk1") = r1("合同价款")/10000
r1("yfk2") = r1("合同价款")/10000
r1("yfk3") = 0
r1("yfk4") = 0
r1("yfk5") = r1("合同价款")/10000
' End If
End If
If r1("备案日期") >=dt1 And r1("备案日期") < dt2
If r1("最终定价") IsNot Nothing
If r1("评审报告日期1") < dt2
r1("yfk1") = 0
r1("yfk2") = r1("最终定价")/10000
r1("yfk3") = 0
r1("yfk4") = 0
r1("yfk5") = r1("最终定价")/10000
End If
If r1("评审报告日期1") >= dt2 And r1("评审报告日期1") <= dt3
r1("yfk1") = 0
r1("yfk2") = r1("合同价款")/10000
r1("yfk3") = r1("最终定价")/10000 - r1("合同价款")/10000
r1("yfk4") = r1("最终定价")/10000 - r1("合同价款")/10000
r1("yfk5") = r1("最终定价")/10000
End If
If r1("评审报告日期1") > dt3
r1("yfk1") = 0
r1("yfk2") = r1("合同价款")/10000
r1("yfk3") = 0
r1("yfk4") = 0
r1("yfk5") = r1("合同价款")/10000
End If
End If
If r1("最终定价") Is Nothing
r1("yfk1") = 0
r1("yfk2") = r1("合同价款")/10000
r1("yfk3") = 0
r1("yfk4") = 0
r1("yfk5") = r1("合同价款")/10000
End If
End If
If r1("备案日期") >=dt2 And r1("备案日期") <=dt3
If r1("最终定价") IsNot Nothing
If r1("评审报告日期1") <= dt3
r1("yfk1") = 0
r1("yfk2") = 0
r1("yfk3") = r1("最终定价")/10000
r1("yfk4") = r1("最终定价")/10000
r1("yfk5") = r1("最终定价")/10000
End If
If r1("评审报告日期1") > dt3
r1("yfk1") = 0
r1("yfk2") = 0
r1("yfk3") = r1("合同价款")/10000
r1("yfk4") = r1("合同价款")/10000
r1("yfk5") = r1("合同价款")/10000
End If
End If
If r1("最终定价") Is Nothing
r1("yfk1") = 0
r1("yfk2") = 0
r1("yfk3") = r1("合同价款")/10000
r1("yfk4") = r1("合同价款")/10000
r1("yfk5") = r1("合同价款")/10000
End If
End If
Else
r1("yfk1") = 0
r1("yfk2") = 0
r1("yfk3") = 0
r1("yfk4") = 0
r1("yfk5") = 0
End If
' If r1("备案日期") <= dt3
r1("yifk1") = DataTables("基建合同执行表").Compute("SUM(支付额1)", "备案编号 = '" & babh & "' And 填报时间 < #" & dt0 & "#")
r1("yifk2") = DataTables("基建合同执行表").Compute("SUM(支付额1)", "备案编号 = '" & babh & "' And 填报时间 < #" & dt2 & "#")
r1("yifk3") = DataTables("基建合同执行表").Compute("SUM(支付额1)", "备案编号 = '" & babh & "' And 填报时间 >= #" & dt2 & "# And 填报时间 <= #" & dt3 & "#")
r1("yifk4") = DataTables("基建合同执行表").Compute("SUM(支付额1)", "备案编号 = '" & babh & "' And 填报时间 >= #" & dt1 & "# And 填报时间 <= #" & dt3 & "#")
r1("yifk5") = DataTables("基建合同执行表").Compute("SUM(支付额1)", "备案编号 = '" & babh & "' And 填报时间 <= #" & dt3 & "#")
'End If
If r1("备案日期") >= dt2
If r1("备案日期") <= dt3
r1("ybbz") = "本月备案合同"
r1("ybrq") = dt3
Else
r1("ybrq") = dt3
r1("ybbz") = "报告月后备案"
End If
Else
r1("ybbz") = "原备案合同"
r1("ybrq") = dt3
End If
Next
求高手指教:带颜色的代码怎么写都不执行,郁闷,哪里错了,