以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]后台计算  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=150042)

--  作者:天一生水
--  发布时间:2020/5/19 11:51:00
--  [求助]后台计算
老师好!下面这段需要加载后进行计算的代码,如果在后台进行,除了把GetValues改成SQLGetValues、把Select改为SQLSelect以外,还要修改什么地方?
谢谢!
Dim codes As List (Of String) = DataTables("指数日线").GetValues("代码","","日期")
For Each code As String In codes
    Dim drlist As List (Of DataRow) = DataTables("指数日线").Select("代码 = \'" & code & "\'")
    For i As Integer = 0 To drlist.Count - 1
        If i = 0 Then
            drlist(i)("涨跌幅") = (drlist(i)("收盘价") - drlist(i)("开盘价")) / drlist(i)("开盘价") * 100%
        Else
            drlist(i)("涨跌幅") = (drlist(i)("收盘价") - drlist(i - 1)("收盘价")) / drlist(i - 1)("收盘价") * 100%
        End If
    Next
Next


--  作者:有点蓝
--  发布时间:2020/5/19 11:54:00
--  
添加保存代码:http://www.foxtable.com/webhelp/topics/2901.htm