Microsoft Access 2003 - 正确布局代码

时间:2010-02-02 13:08:02

标签: sql ms-access

SELECT DISTINCTROW [OEE/A Query].Press, Sum([OEE/A Query].[SumOfLabor Hours]) AS [Sum Of SumOfLabor Hours], Sum([OEE/A Query].[SumOfGood Pieces]) AS [Sum Of SumOfGood Pieces], Sum([OEE/A Query].[Scrap Pieces]) AS [SumOfScrap Pieces], Sum([OEE/A Query].[SumOfMachine Hours]) AS [SumOfSumOfMachine Hours], Sum([OEE/A Query].[Total Parts Hours Earned]) AS [SumOfTotal Parts Hours Earned], Sum([OEE/A Query].[Standard Pcs Expected]) AS [Stand Pcs Expected]
FROM [OEE/A Query]
GROUP BY [OEE/A Query].Press;
SELECT Sum(Sort)+Sum(Straighten)+Sum(Shine)+Sum(Standardize)+Sum(Sustain) AS total
FROM [Shift Report Table];

当我运行此代码时,它会产生一个错误,即“在SQL语句结束后找到的字符”。 那么如何调整此代码以避免任何错误?

2 个答案:

答案 0 :(得分:4)

访问查询不允许您在同一窗口中有两个SELECT查询。所以你必须将你的两个查询分开。

我假设您正在使用Access查询设计窗口

答案 1 :(得分:-1)

我不确定,但我认为你不需要;字符。你拿出来会发生什么?