以文本方式查看主题
- Foxtable(狐表) (http://foxtable.net/bbs/index.asp)
-- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2)
---- [求助] (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=141746)
|
-- 作者:wck197501
-- 发布时间:2019/10/10 10:08:00
-- [求助]
\'以下代码,将各项工程最高计量次数存入变量j中 For i=0 To eagj-1 Step 1 li=1 For Each eagcol As DataCol In DataTables(eagbooks(i)).DataCols If eagcol.name.Contains("mtrNo") Then eagstr = right(eagcol.name,2) ename = "mtrlwgNo" mstr = "mtrNo" echan = ename & cstr(0) & cstr(1) mchan = mstr & cstr(0) & cstr(1) output.show("echan=" & echan) Integer.TryParse(eagstr,eagint) If j < eagint Then j = eagint End If li=li+1 End If Dim antilwgs(j+1) As Double antilwgs(1) = DataTables(eagbooks(1)).Compute("Sum(mtrlwgNo01)", echan & " = \'" & e.DataRow("mtrNo") & "\'" ) \' t & " = \'" & Vars("产品") & "\'")
\'Compute("Sum(mtrlwgNo01)", aa & " = \'" & e.DataRow("mtrNo") & "\'") e.DataRow("antilwg") = antilwgs(i) Next output.show("i=" & i) Next
此主题相关图片如下:qq截图201910103.png
|
-- 作者:狐狸爸爸
-- 发布时间:2019/10/10 10:21:00
--
用MessageBox显示一下合成的条件表达式是什么:
... Dim antilwgs(j+1) As Double MessageBox.Show(echan & " = \'" & e.DataRow("mtrNo") & "\'") antilwgs(1) = DataTables(eagbooks(1)).Compute("Sum(mtrlwgNo01)", echan & " = \'" & e.DataRow("mtrNo") & "\'" ) 。。。
|
-- 作者:wck197501
-- 发布时间:2019/10/13 11:04:00
--
用MessageBox显示一下合成的条件表达式是什么:
...
Dim antilwgs(j+1) As Double
MessageBox.Show(echan & " = \'" & e.DataRow("mtrNo") & "\'")
antilwgs(1) = DataTables(eagbooks(1)).Compute("Sum(mtrlwgNo01)", echan & " = \'" & e.DataRow("mtrNo") & "\'" )
显示的结果是
此主题相关图片如下:qq截图20191013110315.png
|
-- 作者:wck197501
-- 发布时间:2019/10/13 11:51:00
--
聚合函数里的列名是否可以用变量?
|
-- 作者:wck197501
-- 发布时间:2019/10/13 16:32:00
--
聚合函数可以引用变量吗? 此主题相关图片如下:qq截图20191013001.png
|
-- 作者:有点蓝
-- 发布时间:2019/10/13 23:08:00
--
dim s as string = "第一列"datatables(xxxx).compute("sum(" & s & ")")
|