当我运行它时,我收到一条错误消息。你知道为什么吗?我使用 Access 设计视图构建了它。
SELECT [Sales structure].Cluster ,
[Sales structure].Country ,
[Transaction details].[Sales company code] ,
[Sales structure].[Sales company name] ,
YEAR([Transaction details].[YYYY-MM-DD]) AS [Year] ,
MONTH([Transaction details].[YYYY-MM-DD]) AS [Month] ,
SUM([Transaction details].[Sales volume LOC]) AS Total ,
[Transaction details].[Currency code] ,
Currencies.[CUR/EUR] AS [Currency rate]
FROM Items ,
Currencies
RIGHT JOIN ( [Sales structure]
RIGHT JOIN [Transaction details] ON [Sales structure].[Sales company code] = [Transaction details].[Sales company code]
) ON Currencies.[Currency code] = [Transaction details].[Currency code]
GROUP BY [Sales structure].Cluster ,
[Sales structure].Country ,
[Transaction details].[Sales company code] ,
[Sales structure].[Sales company name] ,
YEAR([Transaction details].[YYYY-MM-DD]) ,
MONTH([Transaction details].[YYYY-MM-DD]) ,
[Transaction details].[Currency code] ,
Currencies.[CUR/EUR]
HAVING ( ([Transaction details].[Currency code] = [Currencies].[Currency code]) )
ORDER BY YEAR([Transaction details].[YYYY-MM-DD]) ,
MONTH([Transaction details].[YYYY-MM-DD]) ;