我正在尝试执行下面的 SQL 查询(在 Access DB 中),但出现类型不匹配错误。
SELECT S1.[Main Project] AS Company, S1.[Main Link] AS Project, S1.[Name] AS Milestone, S1.[Start] As MilestoneDueDate,
S2.[Name] As Successor1, S2.[Start] as SuccessorDueDate1,
S3.[Name] As Successor2, S2.[Start] as SuccessorDueDate2,
S4.[Name] As Successor3, S2.[Start] as SuccessorDueDate3,
S5.[Name] As Successor4, S2.[Start] as SuccessorDueDate4,
S6.[Name] As Successor5, S2.[Start] as SuccessorDueDate5,
S7.[Name] As Successor6, S2.[Start] as SuccessorDueDate6,
S8.[Name] As Successor7, S2.[Start] as SuccessorDueDate7,
S9.[Name] As Successor8, S2.[Start] as SuccessorDueDate8,
S10.[Name] As Successor9, S2.[Start] as SuccessorDueDate9,
S11.[Name] As Successor10, S2.[Start] as SuccessorDueDate10
FROM ((((((((((Sheet1 AS S1
INNER JOIN Sheet1 AS S2
ON S1.[Outcoming Task 1] = S2.[ID])
INNER JOIN Sheet1 AS S3
ON S1.[Outcoming Task 2] = S3.[ID])
INNER JOIN Sheet1 AS S4
ON S1.[Outcoming Task 3] = S4.[ID])
INNER JOIN Sheet1 AS S5
ON S1.[Outcoming Task 4] = S5.[ID])
INNER JOIN Sheet1 AS S6
ON S1.[Outcoming Task 5] = S6.[ID])
INNER JOIN Sheet1 AS S7
ON S1.[Outcoming Task 6] = S7.[ID])
INNER JOIN Sheet1 AS S8
ON S1.[Outcoming Task 7] = S8.[ID])
INNER JOIN Sheet1 AS S9
ON S1.[Outcoming Task 8] = S9.[ID])
INNER JOIN Sheet1 AS S10
ON S1.[Outcoming Task 9] = S10.[ID])
INNER JOIN Sheet1 AS S11
ON S1.[Outcoming Task 10] = S11.[ID])
WHERE S1.Start >S2.[Start]
OR S1.Start >S3.[Start]
OR S1.Start >S4.[Start]
OR S1.Start >S5.[Start]
OR S1.Start >S6.[Start]
OR S1.Start >S7.[Start]
OR S1.Start >S8.[Start]
OR S1.Start >S9.[Start]
OR S1.Start >S10.[Start]
OR S1.Start >S11.[Start]
ORDER BY S1.[Main Project]
我是否正确使用了内部连接?
我知道这个表很糟糕(实际上开发它的人应该创建了一个关系表),但它就是这样:(
有没有更优雅的方法来解决它?
谢谢!