I have a query here that seems as though it should work, but I know I have to do some funky parentheses in Access or something to get joins to work correctly. I have several nested left joins and Access does not like my syntax....any suggestions?
SELECT CLASSES.ID
FROM CLASSES
left JOIN COURSES
left JOIN MSTV
left JOIN MSHEADER
ON (MSTV.MsSection = MSHEADER.MsSection)
AND (MSTV.MsCrsNumber =MSHEADER.MsCrsNumber)
AND (MSTV.MsYear = MSHEADER.MsCrsYear)
AND (AAA_ALLMSTV.MsSchool=MSHEADER.MsCrsSchool)
ON (COURSES.CourseNumber = MSTV.MsCrsNumber)
AND (COURSES.CourseYear = MSTV.MsYear)
AND (COURSES.CourseSchool = MSTV.MsSchool)
ON (CLASSES.Crs = COURSES.CourseNumber)
AND (CLASSES.Year = COURSES.CourseYear)
AND (CLASSES.School = COURSES.CourseSchool)
WHERE CLASSES.ID in (select old_student_number from ESIS_IDS);
SELECT CLASSES.ID
FROM CLASSES
left JOIN COURSES
left JOIN MSTV
left JOIN MSHEADER
ON (MSTV.MsSection = MSHEADER.MsSection)
AND (MSTV.MsCrsNumber =MSHEADER.MsCrsNumber)
AND (MSTV.MsYear = MSHEADER.MsCrsYear)
AND (AAA_ALLMSTV.MsSchool=MSHEADER.MsCrsSchool)
ON (COURSES.CourseNumber = MSTV.MsCrsNumber)
AND (COURSES.CourseYear = MSTV.MsYear)
AND (COURSES.CourseSchool = MSTV.MsSchool)
ON (CLASSES.Crs = COURSES.CourseNumber)
AND (CLASSES.Year = COURSES.CourseYear)
AND (CLASSES.School = COURSES.CourseSchool)
WHERE CLASSES.ID in (select old_student_number from ESIS_IDS);