繁体   English   中英

ms-access: 查询表达式中缺少语法错误运算符:

[英]ms-access: syntax error missing operator in query expression:

这是我的查询:

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)])

您没有使用正确的单引号类型

' and ' != '

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM