我有一种感觉,这里一定有一个我看不到的愚蠢错误,但我已经盯着它看了那么久,我不知所措。我正在通过 VBA 生成一条 SQL 语句,但我不断收到一个奇怪的错误。SQL出来看起来像这样:
SELECT c.Junction_ID AS [ID], c.[First_Name] AS [First Name], c.[Last_Name] AS [Last Name],
c.Location, c.Start_Date AS [Start Date], c.End_Date AS [End Date],
s.Helpful_Scale AS [Helpfulness], s.Memory_Scale AS [Memory]
FROM nka_ClassList_Unique c
INNER JOIN nka_Supplemental s ON c.Junction_ID = s.Junction_ID
INNER JOIN nka_ClassList_Unique_Mgrs m ON m.Location = c.Location
AND ((c.Start_Date BETWEEN m.StartDate AND m.EndDate)
OR (c.End_Date BETWEEN m.StartDate AND m.EndDate)
OR (m.StartDate BETWEEN c.Start_Date AND c.End_Date)
OR (m.EndDate BETWEEN c.Start_Date AND c.End_Date))
WHERE ((c.Management = False) AND (c.Dist_Manager = False)
AND (m.Junction_ID = 129880) AND (c.Location = "DEC"))
Access 引发以下错误(我已将其格式化为适合屏幕):
Syntax error (missing operator) in query expression
`c.Junction_ID = s.Junction_ID INNER JOIN nka_Sprint1_ClassList_Unique_Mgrs m
ON m.Location = c.Locatio'.
什么会导致 Access 通过字段名称中途停止解析此查询?它与在一定数量的字符后停止没有任何关系。即使我更改SELECT
表别名语句的长度,它也总是停在c.Locatio
.
关于为什么会这样做的任何想法?我在这里忽略了一些愚蠢的东西。