Syscmd.Project.Save() Dim b As New SQLGroupTableBuilder("统计表1","fhjl") b.Groups.AddDef("批次") b.Totals.AddDef("实孵数量") b.Totals.AddDef("受精蛋") b.Build With DataTables("统计表1") .DataCols.Add("受精率", GetType(Double), "[受精蛋] /[实孵数量]") End With Tables("窗口1_Table1").DataSource = DataTables("统计表1")
Dim b As New SQLGroupTableBuilder("统计表1","fhjl") b.Groups.AddDef("批次") b.Totals.AddDef("实孵数量") b.Totals.AddDef("受精蛋") b.Exprs.Adddef("受精率","[受精蛋]/[实孵数量]",AggregateEnum.Average) b.Build Tables("窗口1_Table1").DataSource = b.BuildDataSource
4楼
liuruihua 发表于:2009/9/26 19:12:00
用户已锁定!
5楼
czy 发表于:2009/9/26 21:10:00
那这样试试
Dim b As New SQLGroupTableBuilder("统计表1","fhjl") b.Groups.AddDef("批次") b.Totals.AddDef("实孵数量") b.Totals.AddDef("受精蛋") b.Exprs.Adddef("受精率","[受精蛋]/[实孵数量]") b.Build DataTables("统计表1").DataCols("受精率").Expression = "[受精蛋] /[实孵数量]" Tables("窗口1_Table1").DataSource = DataTables("统计表1")