`
阅: 243 | 回: 1
发表于2024/11/6 15:34:38 楼主 
头像 等级:初学者
积分:0
财富值:2.0
身份:普通用户

请问一下,表中按字段汇总怎么操作?

原来是我是用宏实现的,以下是我原来的命令。


      strSQL = "select " & [a5] & "," & [b5] & "," & [c5] & "," & [d5] & ",sum(" & [e5] & "),sum(" & [f5] & "),sum(" & [g5] & "),sum(" & [h5] & ")    from [数据源$A2:ak20000] group by " & [a5] & "," & [b5] & "," & [c5] & "," & [d5] & " having " & [a1] & " ='" & [A2] & "' and  (" & [a3] & " in('" & [a4] & "','" & [b4] & "','" & [c4] & "','" & [d4] & "','" & [e4] & "','" & [f4] & "','" & [g4] & "','" & [h4] & "'))ORDER BY " & [a5] & "," & [b5] & "," & [c5] & "," & [d5] & ",sum(" & [e5] & "),sum(" & [f5] & "),sum(" & [g5] & "),sum(" & [h5] & ")DESC"
      

我的个性签名
发表于 2024/11/6 15:35:46   
头像 等级:传说级人物
积分:2532
财富值:6
身份:系统管理员
分类汇总http://www.ffcell.com/WenKu/article.aspx?id=212
方方格子安装教程http://www.ffcell.com/WenKu/article.aspx?id=376

快速回复

目前不允许游客发表,请 登录 注册 后再发贴。