以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 更新版 SQLGroupTableBuilder 统计多一行0数据 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=81873) |
-- 作者:huozhe -- 发布时间:2016/3/8 9:53:00 -- 更新版 SQLGroupTableBuilder 统计多一行0数据 Dim st As Date = Date.Now Dim b As New SQLGroupTableBuilder("综合统计","人员") b.Groups.Adddef("类别") b.Totals.Adddef("类别",AggregateEnum.Count,"人数") b.Totals.Addexp("性别_男","IIF(性别 = \'男\',1,0)") b.Totals.Addexp("性别_女","IIF(性别 = \'女\',1,0)") b.Totals.Addexp("民族_汉族","IIF(民族 = \'汉族\',1,0)") b.Totals.Addexp("民族_少数民族","IIF(民族 <> \'汉族\',1,0)") b.VerticalTotal = True b.Build |
-- 作者:大红袍 -- 发布时间:2016/3/8 10:00:00 -- 应该是你的表里面多了空白的行吧?
Dim st As Date = Date.Now
Dim b As New SQLGroupTableBuilder("综合统计","人员")
b.Groups.Adddef("类别")
b.filter="类别 is not null"
b.Totals.Adddef("类别",AggregateEnum.Count,"人数")
b.Totals.Addexp("性别_男","IIF(性别 = \'男\',1,0)")
b.Totals.Addexp("性别_女","IIF(性别 = \'女\',1,0)")
b.Totals.Addexp("民族_汉族","IIF(民族 = \'汉族\',1,0)")
b.Totals.Addexp("民族_少数民族","IIF(民族 <> \'汉族\',1,0)")
b.VerticalTotal = True
b.Build |
-- 作者:huozhe -- 发布时间:2016/3/8 10:07:00 -- 谢谢!现在可以了,还是之前的数据,更新完以后就多出一行为0的。 |