b.Totals.AddExp("健雏率","iif(([公雏] is null,0,[公雏])+iff([母雏] is null,0,[母雏]))/iif(([公雏] is null,0,[公雏])+iff([母雏] is null,0,[母雏])+iif([次苗] is null,0,[次苗])+iif([死残苗] is null,0,[死残苗]))")
全角 半角?
6楼
liuruihua 发表于:2009/12/28 21:28:00
用户已锁定!
7楼
liuruihua 发表于:2009/12/28 22:50:00
用户已锁定!
8楼
czy 发表于:2009/12/29 0:14:00
Dim b As New SQLGroupTableBuilder("统计表1","fh") b.Groups.AddDef("批次") b.Groups.AddDef("日期",DateGroupEnum.month, "月") b.Totals.AddDef("实孵数量") b.Totals.AddDef("公雏") b.Totals.AddDef("母雏") b.Totals.AddDef("次苗") b.Totals.AddDef("死残苗") b.Totals.AddExp("出苗总数","iif([公雏] is null,0,[公雏])+iif([母雏] is null,0,[母雏])+iif([次苗] is null,0,[次苗])+iif([死残苗] is null,0,[死残苗])") b.Totals.AddExp("健雏率", "iif([公雏] is null And [母雏] is null And [次苗] is null And [死残苗] is null,0,(iif([公雏] is null,0,[公雏])+iif([母雏] is null,0,[母雏]))/(iif([公雏] is null,0,[公雏])+iif([母雏] is null,0,[母雏])+iif([次苗] is null,0,[次苗])+iif([死残苗] is null,0,[死残苗])))",AggregateEnum.Average) b.Decimals=3 b.Build Tables("窗口1_Table1").DataSource = DataTables("统计表1")