ms-access: missing operator in query expression

Posted by every_answer_gets_a_point on Stack Overflow See other posts from Stack Overflow or by every_answer_gets_a_point
Published on 2010-05-13T00:50:35Z Indexed on 2010/05/13 0:54 UTC
Read the original article Hit count: 245

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about sql

Related posts about ms-access