|
strsql = "TRANSFORM Sum([销售记录表].[销售数量]) AS 销售数量之Sum " & "SELECT [销售记录表].[销售商], Sum([销售记录表].[销售数量]) AS [总计 销售数量] " & "FROM 销售记录表 " & "GROUP BY [销售记录表].[销售商] " & "IVOT [销售记录表].[省份];"
CurrentProject.Connection.Execute "drop view 销售记录表_交叉表行业"
CurrentProject.Connection.Execute "create view 销售记录表_交叉表行业 as " & strsql
DoCmd.OpenQuery "销售记录表_交叉表行业"
CurrentProject.Connection.Close
运行会出现"无效的SQL句法,需要符号:select" ,应该是那个strsql语句的问题,但这个语句是从查询转换过来的,应该没错.到底是怎样????????? |
|