简体   繁体   中英

ms-access: missing operator in query expression

i have this sql statement in access:

SELECT *
FROM (SELECT [Occurrence Number], [1 0 Preanalytical (Before Testing)], NULL, NULL,NULL FROM [Lab Occurrence Form] 
WHERE NOT ([1 0 Preanalytical (Before Testing)] IS NULL)
  UNION
  SELECT [Occurrence Number],  NULL, [2 0 Analytical (Testing Phase)], NULL,NULL FROM  [Lab Occurrence Form]  WHERE NOT ([2 0 Analytical (Testing Phase)] IS NULL)
  UNION
  SELECT  [Occurrence Number],  NULL, NULL, [3 0 Postanalytical ( After Testing)],NULL FROM  [Lab Occurrence Form]  WHERE NOT ([3 0 Postanalytical ( After Testing)] IS NULL)
 UNION
  SELECT  [Occurrence Number],  NULL, NULL,NULL  [4 0 Other] FROM  [Lab Occurrence Form]  WHERE NOT ([4 0 Other] IS NULL)
)  AS mySubQuery
ORDER BY mySubQuery.[Occurrence Number];

everything was fine until i added the last line:

SELECT  [Occurrence Number],  NULL, NULL,NULL  [4 0 Other] FROM  [Lab Occurrence Form]  WHERE NOT ([4 0 Other] IS NULL)

i get this error:

syntax error (missing operator) in query expression 'NULL [4 0 Other]'

anyone have any clues why i am getting this error?

您错过了一个逗号:

NULL,  [4 0 Other]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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