sql不会! 就你上面的例子代码改成:没问题了~
MainTable = Tables("H_YIZ")
for i as integer = 0 to datatables("H_YIZ").DataRows.count-1
if currenttable(i,"单位") = "" then
currenttable(i,"单位") = "^_^"
end if
next
Dim g As New GroupTableBuilder("清单1",DataTables("H_YIZ"))
g.Groups.AddDef("住院ID")
g.Groups.AddDef("类别")
g.Groups.AddDef("项目")
g.Groups.AddDef("规格")
g.Groups.AddDef("单位")
g.Groups.AddDef("单价")
g.Totals.AddDef("用量")
g.Totals.AddDef("天数")
g.Build()
With DataTables("清单1")
.DataCols.Add("余额", GetType(Double), "[单价] * [用量] * [天数]")
End With
for i as integer = 0 to datatables("H_YIZ").DataRows.count-1
if currenttable(i,"单位") = "^_^" then
currenttable(i,"单位") = ""
end if
next
MainTable = Tables("清单1")