|
- If SH0.Range("N2").Value = "一级机构" Then
- StrBT = "一级机构"
- Else
- If SH0.Range("N2").Value = "二级机构" Then
- StrBT = "一级机构,二级机构"
- Else
- StrBT = "一级机构,二级机构,三级机构"
- End If
- End If
- StrSQL = ""
- StrSQL = StrSQL & "SELECT " & StrBT
- StrSQL = StrSQL & ",COUNT(一级机构) AS 总数"
- StrSQL = StrSQL & ",SUM(IIF([类型M2/M3/M4]='M2' OR [类型M2/M3/M4]='M3',1,0)) AS [M2/M3]"
- StrSQL = StrSQL & ",SUM(IIF([类型M2/M3/M4]='M4' ,1,0)) AS [M4]"
- StrSQL = StrSQL & ",SUM(金额) AS 金额"
- StrSQL = StrSQL & " FROM [" & SH0.Name & "$A2:J]"
- StrSQL = StrSQL & " WHERE [登记时间]=#" & "2018-07-05" & "#" '//FORMAT(NOW,"yyyy-MM-dd")
- StrSQL = StrSQL & " GROUP BY " & StrBT
复制代码 |
评分
-
1
查看全部评分
-
|