以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- SQLJoinTableBuilder后台统计出错 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=123155) |
-- 作者:ZJZK2018 -- 发布时间:2018/8/9 1:33:00 -- SQLJoinTableBuilder后台统计出错 老师: Tables("标录分析_Table01")是生成的查询表动态绑定到这个副表,“标录明细”是外部表(SQL),我的需求是:根据Tables("标录分析_Table01")表中的系统编号来生成另一个查询表【Tables("标录分析_Table06")】,但下面代码出错了,如何调整,谢谢! Dim tb1 As Table = Tables("标录分析_Table01") Dim tb6 As Table = Tables("标录分析_Table06") Dim jb As New SQLJoinTableBuilder("标录明细汇总表","tb1.DataTable.Name") jb.C jb.AddTable("tb1.DataTable.Name","系统编号","标录明细","系统编号") jb.AddCols("开标日期","开标时间","咨询类型","{标录明细}.系统编号","{标录明细}.项目名称","本期概算","标准基价","招标控制价","风险控制价","最高限价","最低限价","投标单位","中标候选人","开标地址","工程类别","投标球号","投标报价","评标基准价") jb.AddExp("下浮率_招标控制价","Case When 招标控制价 > 0 And 投标报价 > 0 Then 1 - 投标报价 / 招标控制价 Else 0 End") jb.AddExp("下浮率_风险控制价","Case When 风险控制价 > 0 And 投标报价 > 0 Then 1 - 投标报价 / 风险控制价 Else 0 End") jb.AddExp("下浮率_最高限价","Case When 最高限价 > 0 And 投标报价 > 0 Then 1 - 投标报价 / 最高限价 Else 0 End") jb.AddExp("下浮率_最低限价","Case When 最低限价 > 0 And 投标报价 > 0 Then 1 - 投标报价 / 最低限价 Else 0 End") \'jb.Build() \'MainTable = Tables("查询表1") tb6.DataSource = jb.BuildDataSource |
-- 作者:有点甜 -- 发布时间:2018/8/9 9:35:00 -- 1、生成的查询表、窗口表、临时表,都不可以再用sql方式再次统计;
2、复杂的统计,建议你直接写sql语句直接生成吧。 |
-- 作者:ZJZK2018 -- 发布时间:2018/8/9 15:29:00 -- 生成一个“标录明细汇总表”查询表,然后根据tb1表中已有的“系统编号”,只要包含的全部统计出来,但下面代码错在哪里? Dim tb1 As Table = Tables("标录分析_Table01") Dim tb6 As Table = Tables("标录分析_Table06") Dim jb As New SQLJoinTableBuilder("标录明细汇总表","标录明细") jb.C jb.AddTable("标录明细","系统编号","招标信息","系统编号") jb.AddCols("开标日期","开标时间","{标录明细}.系统编号","{标录明细}.项目名称","本期概算","标准基价","招标控制价","风险控制价","最高限价","最低限价","投标单位","中标候选人","投标球号","投标报价","评标基准价") jb.AddExp("下浮率_招标控制价","Case When 招标控制价 > 0 And 投标报价 > 0 Then 1 - 投标报价 / 招标控制价 Else 0 End") jb.AddExp("下浮率_风险控制价","Case When 风险控制价 > 0 And 投标报价 > 0 Then 1 - 投标报价 / 风险控制价 Else 0 End") jb.AddExp("下浮率_最高限价","Case When 最高限价 > 0 And 投标报价 > 0 Then 1 - 投标报价 / 最高限价 Else 0 End") jb.AddExp("下浮率_最低限价","Case When 最低限价 > 0 And 投标报价 > 0 Then 1 - 投标报价 / 最低限价 Else 0 End") For Each dr1 As Row In tb1.Rows jb.Filter = "{标录明细}.系统编号 = \'" & dr1("系统编号") & "\'" Next tb6.DataSource = jb.BuildDataSource |
-- 作者:有点蓝 -- 发布时间:2018/8/9 16:01:00 -- dim filter as string For Each dr1 As Row In tb1.Rows filter = filter & ",\'" dr1("系统编号") & "\'" Next filter = filter.trim(",") msgbox(filter) jb.Filter = "{标录明细}.系统编号 in (" & filter & ")"
|