以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  字符串,运算符出错。  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=107712)

--  作者:yancheng
--  发布时间: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编辑过]

--  作者:有点甜
--  发布时间: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编辑过]