我在SQL中编写了一个查询,并希望在Microsoft Access 2010中使用它。我完成了大部分必要的翻译,但似乎我错过了一个。但是,我找不到错误是什么。谁能找到错误?
Hash = 1210600964 * 31 + -837896230
答案 0 :(得分:0)
MS Access需要在连接周围添加额外的括号,因此这可能有效:
SELECT dbo_job.item, sub2.item AS NewCheck
FROM (dbo_job LEFT JOIN
(SELECT dbo_job.item
FROM dbo_job
WHERE dbo_job.job_date<=#7/13/2015# AND dbo_job.job_date>=#6/22/2015#
GROUP BY dbo_job.item
) AS sub
ON sub.item = dbo_job.item
) LEFT JOIN
(SELECT dbo_job.item
FROM dbo_job
WHERE dbo_job.job_date<#7/13/2015#
GROUP BY dbo_job.item
) AS sub2
ON sub2.item = dbo_job.item
WHERE dbo_job.job_date = #7/20/2015# AND sub.item IS NULL
GROUP BY dbo_job.item, sub2.item;