以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]我需要获取后台数据做统计,怎样写比较好?【已解决】  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=164244)

--  作者:zto001
--  发布时间:2021/5/1 0:39:00
--  [求助]我需要获取后台数据做统计,怎样写比较好?【已解决】


        Dim cmd As New SQLCommand
        cmd.C
        cmd.CommandText = "Select Sum(运费),Sum(实收邮费),Count(邮件号)  From {" & 数据.value & "} Where 货主=\'橙逸\'" 

这样写能行吗?值怎么写?

我需要统计分析大量数据,应该这种方法最快吧
[此贴子已经被作者于2021/5/2 15:53:36编辑过]

--  作者:有点酸
--  发布时间:2021/5/1 9:00:00
--  
熟悉sql语句的话,这样写最好了
--  作者:zto001
--  发布时间:2021/5/2 0:52:00
--  
Dim cmd As new SQLCommand 
cmd.CommandText = "Select Sum(数量) As 数量, Sum(数量 * 单价) As 金额 from {订单} Where 产品 = \'PD01\'"
cmd.ConnectionName = "数据源名称"
Dim Values = cmd.ExecuteValues
If Values.Count > 0 Then
    Output.show(Values("数量"))
    Output.show(Values("金额"))
End If
使用方法