这是我的查询:
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 :(得分:2)
您没有使用正确的单引号类型
‘ and ’ != '