我有这个查询,它在SQL
服务器中运行良好,但在 Access 中运行良好,我在转换它时遇到了麻烦。我一直听说JET
缺少一些TSQL
功能,我想复杂的连接就是其中之一。
SELECT C.[Position], TT.[Description] as TrainingType, T.ProgramTitle, T.ProgramSubTitle, T.ProgramCode, ET.CompletedDate
from HR_Curriculum C
LEFT JOIN HR_Trainings T ON C.TrainingID = T.TrainingID
LEFT JOIN HR_TrainingTypes TT ON T.TrainingTypeID = TT.TrainingTypeID
LEFT JOIN HR_EmployeeTrainings ET ON C.TrainingID = ET.TrainingID
AND (ET.AvantiRecID IS NULL OR ET.AvantiRecID = '637')
where ( c.[Position] = 'Customer Service Representative'
OR C.[Position] = 'All Employees')
order by [Position], Description, ProgramTitle
我尝试将额外的连接子句放在 WHERE 子句中,但由于某种原因,这不会产生正确的记录计数。