Foxtable(狐表)用户栏目专家坐堂 → 字符串,运算符出错。


  共有1702人关注过本帖树形打印复制链接

主题:字符串,运算符出错。

帅哥哟,离线,有人找我吗?
yancheng
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:843 积分:5982 威望:0 精华:0 注册:2013/6/29 9:36:00
字符串,运算符出错。  发帖心情 Post By:2017/10/8 14:40:00 [只看该作者]


图片点击可在新窗口打开查看此主题相关图片如下:uc截图20171008143749.png
图片点击可在新窗口打开查看


Dim strs() As String = {"n1","n2","n3"}
Dim strs1() As String = {"货币资金","应收账款","应收账款坏账准备"}
'Dim strs2() As String = {}
'会计科目中提取'货币资金'的科目代码
For i As Integer = 0 To strs.Length-1
    Dim lst As List(of String) = DataTables("会计科目").GetValues("科目代码","资产负债表 like '" & strs1(i) &  "," & "% ' or 资产负债表 like '% " & "," & strs1(i) & " '")
    Dim str As String
    For Each ids As String In lst
        str & =  ids & ","
    Next
    str = str.Trim(",")
    Dim x As Double  = tb2.sqlCompute("sum(余额)","科目代码 in (" & str & ") And  摘要 = ' 本 年 累 计' and 会计期间 = '" & Vars("会计期间") & "' ")
'output.show(str)
output.show(x)
Next
[此贴子已经被作者于2017/10/8 14:41:49编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/10/8 15:40:00 [只看该作者]

Dim strs() As String = {"n1","n2","n3"}
Dim strs1() As String = {"货币资金","应收账款","应收账款坏账准备"}
'Dim strs2() As String = {}
'会计科目中提取'货币资金'的科目代码
For i As Integer = 0 To strs.Length-1
    Dim lst As List(of String) = DataTables("会计科目").GetValues("科目代码","资产负债表 like '" & strs1(i) &  "," & "%' or 资产负债表 like '%" & "," & strs1(i) & "'")
    Dim str As String
    For Each ids As String In lst
        str & =  ids & ","
    Next
    str = str.Trim(",")
    Dim x As Double  = tb2.sqlCompute("sum(余额)","科目代码 in (" & str & ") And  摘要 = ' 本 年 累 计' and 会计期间 = '" & Vars("会计期间") & "' ")
'output.show(str)
output.show(x)
Next
[此贴子已经被作者于2017/10/8 15:39:59编辑过]

 回到顶部