简体   繁体   English

ms-access:数据库引擎找不到输入表或查询

[英]ms-access: DB engine cannot find input table or query

here's the query: 这是查询:

SELECT *
FROM (SELECT [Occurrence Number], [Occurrence Date], [1 0 Preanalytical (Before Testing)], [Cup Type], NULL as [2 0 Analytical (Testing Phase)], [2 0 Area], NULL as [3 0 Postanalytical ( After Testing)],NULL as  [4 0 Other], [Practice Code], [Specimen ID #] FROM [Lab Occurrence Form] 
WHERE NOT ([1 0 Preanalytical (Before Testing)] IS NULL)
  UNION
  SELECT [Occurrence Number],  [Occurrence Date],NULL, [Cup Type],[2 0 Analytical (Testing Phase)],  [2 0 Area], NULL,NULL, [Practice Code], [Specimen ID #] FROM  [Lab Occurrence Form]  WHERE NOT ([2 0 Analytical (Testing Phase)] IS NULL)
  UNION
  SELECT  [Occurrence Number],  [Occurrence Date],NULL, [Cup Type],NULL,  [2 0 Area], [3 0 Postanalytical ( After Testing)],NULL, [Practice Code], [Specimen ID #] FROM  [Lab Occurrence Form]  WHERE NOT ([3 0 Postanalytical ( After Testing)] IS NULL)
 UNION
  SELECT  [Occurrence Number],  [Occurrence Date],NULL, [Cup Type],NULL, [2 0 Area], NULL,  [4 0 Other] FROM  [Lab Occurrence Form], [Practice Code], [Specimen ID #]  WHERE NOT ([4 0 Other] IS NULL)
)  AS mySubQuery
ORDER BY mySubQuery.[Occurrence Number];

for some reason it doesnt like [Practice Code]. 由于某种原因,它不喜欢[Practice Code]。 it's definitely a column in the table so i dont understand the problem. 这绝对是在表中的列,所以我不明白这个问题。

the error is 错误是

the microsoft office access database engine cannot find the input table or query 'Practice Code'........ Microsoft Office Access数据库引擎找不到输入表或查询“实践代码” ........

Well, the error says it all. 好吧,错误说明了一切。 It is not a table. 它不是桌子。 In your question, you state that it is a column in a table. 在您的问题中,您声明它是表中的一列。 You have [Lab Occurrence Form], [Practice Code], [Specimen ID #] right after a from, so it assumes all those listed there are tables. 您在[Lab Occurrence Form], [Practice Code], [Specimen ID #][Lab Occurrence Form], [Practice Code], [Specimen ID #] ,因此假定其中列出的所有表格都存在。

The last SQL SELECT in the UNION has a messed up FROM clause: UNION中的最后一个SQL SELECT有一个混乱的FROM子句:

  SELECT [Occurrence Number],  [Occurrence Date],NULL, [Cup Type],NULL, [2 0 Area], NULL,  [4 0 Other] 
  FROM  [Lab Occurrence Form], [Practice Code], [Specimen ID #]  
  WHERE NOT ([4 0 Other] IS NULL) 

You seem to have put two fields in the FROM clause, [Practice Code] and [Specimen ID #]. 您似乎在FROM子句中放置了两个字段,即[实践代码]和[标本ID#]。

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

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