Dim smartID As String = "YFHX202306-0015"
'应付副表本地表
Dim jb1 As New SQLJoinTableBuilder("检查", "应付副表本地表")
Jb1.AddExp("类型", "'本地表'")
Jb1.AddExp("本单单号", "smartID")
Jb1.AddExp("成色", "materialName1")
Jb1.AddExp("工费", "actualAmount")
Jb1.AddExp("银重", "actualweight")
Jb1.Filter = "{应付副表本地表}.smartID = '" & smartID & "'"
'R03_payable_Detail1
Dim jb2 As New SQLJoinTableBuilder("检查", "R03_payable_Detail1")
jb2.C
jb2.AddTable("R03_payable_Detail1", "ID", "R03_payable_Detail3", "ID")
Jb2.AddExp("类型", "'外部表'")
Jb2.AddExp("本单单号", "R03_payable_Detail1.smartID")
Jb2.AddExp("成色", "materialName")
Jb2.AddExp("工费", "-actualAmount")
Jb2.AddExp("银重", "-actualweight")
Jb2.Filter = "R03_payable_Detail1.smartID = '" & smartID & "'"
'组合jb1
jb1.Merge(jb2) '组合jb2
jb1.Build()
MainTable = Tables("检查")
Dim Sum1 As String = Tables("检查").Compute("Sum(工费)*0.01") ' Double Decimal String 这三种类型,但出来的结果只是趋近于0,但不等于,导致下面的判断无法正常使用,但实际结果是等于0的
代码改成下面这种,会不会有bug
Dim Sum1 As Decimal = Format(Tables("检查").Compute("Sum(工费)"), "#0.00")
MessageBox.Show("" & Sum1 & "")
If "" & Sum1 & "" <> 0 Then
MessageBox.Show("实收工费错误")
End If
老师,帮忙看下怎么优化
[此贴子已经被作者于2023/6/21 13:21:23编辑过]