以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  统计  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=185702)

--  作者:飞123
--  发布时间:2023/3/11 12:12:00
--  统计
b2.Totals.AddExp ( "销售_金额", "数量*单价")
b1.Totals.AddExp ( "进货_金额", "数量*单价")
这两行代码有什么不同,为什么第一行代码注释后,就能正常运行

Dim b1 As New SQLGroupTableBuilder("统计表", "进货单")
Dim d1 As fxDataSource
b1.Groups.AddDef("型号")
b1.Totals.AddDef ("数量", "进货_数量")
b1.Totals.AddExp ( "进货_金额", "数量*单价")
d1 = b1.BuildDataSource

Dim b2 As New SQLGroupTableBuilder("统计表", "销售单")
Dim d2 As fxDataSource
b2.Groups.AddDef("型号")
b2.Totals.AddDef ("数量", "销售_数量")
b2.Totals.AddExp ( "销售_金额", "数量*单价")
d2 = b2.BuildDataSource

Dim b3 As New SQLGroupTableBuilder("统计表", "退货单")
Dim d3 As fxDataSource
b3.Groups.AddDef("型号")
b3.Totals.AddDef ("数量", "退货_数量")
b3.Totals.AddExp ( "退货_金额", "数量*单价")
d3 = b3.BuildDataSource

d1.Combine ("型号", d2, "型号")
d1.Combine ("型号", d3, "型号")

Tables("窗口3_Table1").DataSource = d1
With DataTables ("窗口3_Table1").DataCols
    .Add("库存_数量", GetType(Integer), "isnull([进货_数量], 0) - isnull([销售_数量], 0) - isnull([退货_数量], 0)")
    .Add ("库存_金额", GetType(Double), "[库存_数量]*[进货_金额]")
End With

--  作者:有点蓝
--  发布时间:2023/3/11 13:12:00
--  
都一样的东西,是不是列名写错了