Foxtable(狐表)用户栏目专家坐堂 → sqlselct 找出来行数据之后 的计算方法


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

主题:sqlselct 找出来行数据之后 的计算方法

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


加好友 发短信
等级:狐神 帖子:5015 积分:25363 威望:0 精华:0 注册:2015/8/18 9:21:00
  发帖心情 Post By:2016/2/14 9:41:00 [显示全部帖子]

试试用连接直接求和:

Dim cmd4 As New SQLCommand
cmd4.C
cmd4.CommandText = "S ELECT c.fchrGatheringVouchDetailID ,Sum(c.flotCurrentAmount) as 求和 From {GatheringVouchDetail} as gvd inner join {StoredCardRecord} as c on gvd.fchrGatheringVouchDetailID = c.fchrGatheringVouchDetailID wh ere gvd.fchrGatheringVouchID = '" & gvid & "' group by c.fchrGatheringVouchDetailID "
Dim val As Integer = cmd4.ExecuteScalar()
msgbox(val)

 回到顶部