以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 求助统计表 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=81304) |
-- 作者:zchlln -- 发布时间:2016/2/24 10:52:00 -- 求助统计表 Dim g As New CrossTableBuilder("统计表1", DataTables("回款表")) g.HGroups.AddDef("企业名称") g.HGroups.AddDef("车牌号") g.HGroups.AddDef("回款方式") g.Build() MainTable = Tables("统计表1")
以上代码出现不存在名为统计表1的表 |
-- 作者:大红袍 -- 发布时间:2016/2/24 10:54:00 -- 交叉统计,你要设置 HGroups 也要设置 VGroups 以及要统计的列的
http://www.foxtable.com/help/topics/0678.htm
|
-- 作者:zchlln -- 发布时间:2016/2/24 13:22:00 -- 那我不应该用交叉统计 如果只想 提取表的部分列的数据 不进行统计 应该用那个呢 |
-- 作者:大红袍 -- 发布时间:2016/2/24 14:14:00 --
http://www.foxtable.com/help/topics/0680.htm
http://www.foxtable.com/help/topics/1533.htm
|
-- 作者:zchlln -- 发布时间:2016/2/25 9:05:00 -- Dim txt As String = e.Form.Controls("DateTimePicker1").Text txt = "\'%" & txt.Replace("-0", "/").replace("-", "/") & "%\'" Dim Cols1() As String = {"车牌号","收款金额","收款方式"} Dim Cols2() As String = {"车牌号","金额","收款方式"} For Each dr1 As DataRow In DataTables("回款表").Select("[收款日期] = txt" ) Dim dr2 As DataRow = DataTables("回款统计表").AddNew() For i As Integer = 0 To Cols1.Length -1 dr2(Cols2(i)) = dr1(Cols1(i)) Next Next
未找到TXT列 代码写的不对么 |
-- 作者:大红袍 -- 发布时间:2016/2/25 9:15:00 -- Dim txt As String = e.Form.Controls("DateTimePicker1").Text
Dim Cols1() As String = {"车牌号","收款金额","收款方式"}
Dim Cols2() As String = {"车牌号","金额","收款方式"}
For Each dr1 As DataRow In DataTables("回款表").Select("[收款日期] = #" & txt & "#" )
Dim dr2 As DataRow = DataTables("回款统计表").AddNew()
For i As Integer = 0 To Cols1.Length -1
dr2(Cols2(i)) = dr1(Cols1(i))
Next
Next
|
-- 作者:zchlln -- 发布时间:2016/2/25 10:18:00 -- Dim txt As String = e.Form.Controls("DateTimePicker1").Text Dim Cols1() As String = {"车牌号","收款金额","回款方式"} Dim Cols2() As String = {"回款表_车牌号","回款表_金额","回款表_回款方式"} For Each dr1 As DataRow In DataTables("回款表").Select(("[收款日期] = #" & txt & "#" )And "回款方式" = "\'现金\'") Dim dr2 As DataRow = DataTables("回款统计表").AddNew() For i As Integer = 0 To Cols1.Length -1 dr2(Cols2(i)) = dr1(Cols1(i)) Next Next 从字符串“[收款日期] = #2016-02-24#”到类型“Boolean”的转换无效。 我又加了个条件 收款日期的计算就出现问题了
|
-- 作者:大红袍 -- 发布时间:2016/2/25 10:19:00 -- For Each dr1 As DataRow In DataTables("回款表").Select(("[收款日期] = #" & txt & "# And 回款方式 = \'现金\'") |
-- 作者:zchlln -- 发布时间:2016/2/25 10:23:00 -- 此主题相关图片如下:@j0fo@uux~fo5oid%`7gm%n.png |
-- 作者:大红袍 -- 发布时间:2016/2/25 10:36:00 -- For Each dr1 As DataRow In DataTables("回款表").Select("[收款日期] = #" & txt & "# And 回款方式 = \'现金\'") |