2010-07-07 78 views
-1

這裏是我的查詢:MS-訪問:語法錯誤缺少運營商在查詢表達式:

SELECT IIf([Lab Occurrence Form].[2 0 Analytical (Testing Phase)] Like ‘*2.5*Other*’,’2.5 Other’,[Lab Occurrence Form].[2 0 Analytical (Testing Phase)]) AS [Occurrence Code], Count([Lab Occurrence Form].[2 0 Analytical (Testing Phase)]) AS [Count] 
FROM [Lab Occurrence Form] 
WHERE ((([Lab Occurrence Form].[Occurrence Date]) Between Forms!Meeting_Reasons_Frequency!Text4 And Forms!Meeting_Reasons_Frequency!Text2)) And [Lab Occurrence Form].[2 0 Analytical (Testing Phase)] Like '*2.*' 
GROUP BY IIf([Lab Occurrence Form].[2 0 Analytical (Testing Phase)] Like ‘*2.5*Other*’,’2.5 Other’,[Lab Occurrence Form].[2 0 Analytical (Testing Phase)]) 
HAVING ((Count([Lab Occurrence Form].[2 0 Analytical (Testing Phase)]))<>0); 

我得到一個錯誤:

syntax error missing operator in query expression: GROUP BY IIf([Lab Occurrence Form].[2 0 Analytical (Testing Phase)] Like ‘*2.5*Other*’,’2.5 Other’,[Lab Occurrence Form].[2 0 Analytical (Testing Phase)]) 

沒有人知道這裏有什麼問題嗎?

這裏是我的查詢工作的例子,這是基本相同的事情:這工作:

SELECT IIf([Lab Occurrence Form].[1 0 Preanalytical (Before Testing)] Like '*1.11*Other*','1.11 Other',[Lab Occurrence Form].[1 0 Preanalytical (Before Testing)]) AS [Occurrence Code], Count([Lab Occurrence Form].[1 0 Preanalytical (Before Testing)]) AS [Count] 
FROM [Lab Occurrence Form] 
WHERE ((([Lab Occurrence Form].[Occurrence Date]) Between Forms!Meeting_Reasons_Frequency!Text4 And Forms!Meeting_Reasons_Frequency!Text2)) And [Lab Occurrence Form].[1 0 Preanalytical (Before Testing)] Like '*1.*' 
GROUP BY IIf([Lab Occurrence Form].[1 0 Preanalytical (Before Testing)] Like '*1.11*Other*','1.11 Other',[Lab Occurrence Form].[1 0 Preanalytical (Before Testing)]) 
HAVING ((Count([Lab Occurrence Form].[1 0 Preanalytical (Before Testing)]))<>0) 
ORDER BY IIf([Lab Occurrence Form].[1 0 Preanalytical (Before Testing)] Like '*1.11*Other*','1.11 Other',[Lab Occurrence Form].[1 0 Preanalytical (Before Testing)]) 
+0

我的$神但你問了很多非常愚蠢的問題。 – 2010-07-08 03:23:26

回答

1

您沒有使用正確的單引號類型

‘ and ’ != '

+0

非常感謝你!!!!!!!!!!!!!!! – 2010-07-07 00:21:33

相關問題