sql编码出错

时间:2014-05-17 08:23:53

标签: sql ms-access

我在Access中有一个SQL查询,我收到此错误消息:

  

SELECT语句包含保留字或参数名称   拼写错误或丢失,或标点符号不正确

查询:

select* into #temp from mfr
union
select* from polmfr
select rfno,
sum(ppic) as ppic, 
sum(pcrt) as pcrt 
from #temp 
group by rfno

SELECT MFR.RFNO,
Sum([MFR]![THAN]) AS THAN, 
Sum([MFR]![CRT]) AS CRT, 
Sum([MFR]![GPCS]) AS GPCS, 
Sum([MFR]![RCRT]) AS RCRT, 
Sum([MFR]![GCRT]) AS GCRT, 
Sum([MFR]![GFPCS]) AS GFPCS,
Sum([MFR]![GFCRT]) AS GFCRT,
Sum([MFR]![PPIC]) AS PPIC, 
Sum([MFR]![PCRT]) AS PCRT, 
Sum([MFR]![KP]) AS KP, 
Sum([MFR]![KPCRT]) AS KPCRT, 
Sum([MFR]![GPCS])-(Sum([MFR]![GFPCS])) AS GKP, [GCRT]/Sum(IIf([MFR]![GCRT]>0,[MFR]!        [RCRT],0)) AS [G%], 
Sum(IIf([MFR]![GCRT]>0,[MFR]![GFCRT],0))/[GCRT] AS [RB%], [GFCRT]/[RCRT] AS [GF%],   [THAN]/[CRT] AS [SIZE], [PCRT]/Sum(IIf([MFR]![PCRT]>0,[MFR]![RCRT],0)) AS [P%], 
FROM MFR
group by rfno
ORDER BY MFR.RFNO;

0 个答案:

没有答案