SQL question

A

Antney

Can anyone help me with this? I keep getting a "(missing operator)" error and
when I do try and add parentheses, I get a "JOIN" error on the first "ON"
instance. All of this is happening in the FROM portion of the query.

If anyone could help, I would appreciate it.

Thanks,

Antney

Here's the code:

SELECT TOP 100 PERCENT dbo_MST_0001.SE AS [Section], dbo_MST_0001.PD AS
Period, dbo_MST_0001.SM AS Semester, dbo_MST_0001.CN AS CourseID,
dbo_CRS_0001.CO AS Course, dbo_CRS_0001.C3 AS CrsCBEDSCode, dbo_MST_0001.TN
AS TchrNum, dbo_STU_0001.SC AS SchoolNum, dbo_STU_0001.LN AS StudentLast,
dbo_STU_0001.FN AS StudentFirst, dbo_STU_0001.ID AS StudentID,
dbo_STU_0001.SX AS Gender, dbo_STU_0001.GR AS Grade, CONVERT(varchar,
dbo_STU_0001.BD, 101) AS Birthdate, dbo_STU_0001.EC AS Ethnicity,
dbo_MST_0001.PR AS Program, dbo_TCH_0001.TN AS TeacherID, dbo_TCH_0001.TF AS
TchrFirst, dbo_TCH_0001.TLN AS TchrLast, dbo_STU_0001.TG AS LeaveStatus,
dbo_STU_0001.SN AS StudentNumOLD

INTO dbo.vwStudentSchedule_0001

FROM dbo_STU_0001 INNER JOIN dbo_SEC_0001 ON dbo_STU_0001.SC =
dbo_SEC_0001.SC AND dbo_STU_0001.SN = dbo_SEC_0001.SN INNER JOIN
dbo_MST_0001 ON dbo_SEC_0001.SE = dbo_MST_0001.SE AND dbo_SEC_0001.SC =
dbo_MST_0001.SC INNER JOIN dbo_CRS_0001 ON dbo_MST_0001.CN = dbo_CRS_0001.CN
INNER JOIN dbo_TCH_0001 ON dbo_MST_0001.SC =
dbo_TCH_0001.SC AND dbo_MST_0001.TN = dbo_TCH_0001.TN INNER JOIN
dbo_LOC_0001 ON dbo_STU_0001.SC = dbo_LOC_0001.CD

WHERE (dbo_MST_0001.DEL = 0) AND (dbo_CRS_0001.DEL = 0) AND
(dbo_STU_0001.DEL = 0) AND (dbo_TCH_0001.DEL = 0) AND (dbo_SEC_0001.DEL = 0)
AND (dbo_STU_0001.TG = '')

ORDER BY dbo_STU_0001.LN, dbo_STU_0001.FN;
 
A

Antney

I figured it out, thanks anyway.

Code:

SELECT dbo_MST_0001.SE AS [Section], dbo_MST_0001.PD AS Period,
dbo_MST_0001.SM AS Semester, dbo_MST_0001.CN AS [Course ID], dbo_CRS_0001.CO
AS Course, dbo_CRS_0001.C3 AS CrsCBEDSCode, dbo_MST_0001.TN AS TchrNum,
dbo_STU_0001.SC AS SchoolNum, dbo_STU_0001.LN AS StudentLast, dbo_STU_0001.FN
AS StudentFirst, dbo_STU_0001.ID AS StudentID, dbo_STU_0001.SX AS Gender,
dbo_STU_0001.GR AS Grade, dbo_STU_0001.BD AS Birthdate, dbo_STU_0001.EC AS
Ethnicity, dbo_MST_0001.PR AS Program, dbo_TCH_0001.TN AS TeacherID,
dbo_TCH_0001.TF AS TchrFirst, dbo_TCH_0001.TLN AS TchrLast, dbo_STU_0001.TG
AS [Leave Status], dbo_STU_0001.SN AS StudentNumOLD
FROM ((((dbo_STU_0001 INNER JOIN dbo_SEC_0001 ON (dbo_STU_0001.SC =
dbo_SEC_0001.SC) AND (dbo_STU_0001.SN = dbo_SEC_0001.SN)) INNER JOIN
dbo_MST_0001 ON (dbo_SEC_0001.SE = dbo_MST_0001.SE) AND (dbo_SEC_0001.SC =
dbo_MST_0001.SC)) INNER JOIN dbo_CRS_0001 ON dbo_MST_0001.CN =
dbo_CRS_0001.CN) INNER JOIN dbo_TCH_0001 ON (dbo_MST_0001.SC =
dbo_TCH_0001.SC) AND (dbo_MST_0001.TN = dbo_TCH_0001.TN)) INNER JOIN
dbo_LOC_0001 ON dbo_STU_0001.SC = dbo_LOC_0001.CD
WHERE (((dbo_MST_0001.DEL)=0) AND ((dbo_CRS_0001.DEL)=0) AND
((dbo_STU_0001.DEL)=0) AND ((dbo_TCH_0001.DEL)=0) AND ((dbo_SEC_0001.DEL)=0)
AND ((dbo_STU_0001.TG)=" "))
GROUP BY dbo_MST_0001.SE, dbo_MST_0001.PD, dbo_MST_0001.SM, dbo_MST_0001.CN,
dbo_CRS_0001.CO, dbo_CRS_0001.C3, dbo_MST_0001.TN, dbo_STU_0001.SC,
dbo_STU_0001.LN, dbo_STU_0001.FN, dbo_STU_0001.ID, dbo_STU_0001.SX,
dbo_STU_0001.GR, dbo_STU_0001.BD, dbo_STU_0001.EC, dbo_MST_0001.PR,
dbo_TCH_0001.TN, dbo_TCH_0001.TF, dbo_TCH_0001.TLN, dbo_STU_0001.TG,
dbo_STU_0001.SN
ORDER BY dbo_STU_0001.LN, dbo_STU_0001.FN;


Antney said:
The "(missing operator)" error is occuring on the first "And" in the FROM
portion.

Antney said:
Can anyone help me with this? I keep getting a "(missing operator)" error and
when I do try and add parentheses, I get a "JOIN" error on the first "ON"
instance. All of this is happening in the FROM portion of the query.

If anyone could help, I would appreciate it.

Thanks,

Antney

Here's the code:

SELECT TOP 100 PERCENT dbo_MST_0001.SE AS [Section], dbo_MST_0001.PD AS
Period, dbo_MST_0001.SM AS Semester, dbo_MST_0001.CN AS CourseID,
dbo_CRS_0001.CO AS Course, dbo_CRS_0001.C3 AS CrsCBEDSCode, dbo_MST_0001.TN
AS TchrNum, dbo_STU_0001.SC AS SchoolNum, dbo_STU_0001.LN AS StudentLast,
dbo_STU_0001.FN AS StudentFirst, dbo_STU_0001.ID AS StudentID,
dbo_STU_0001.SX AS Gender, dbo_STU_0001.GR AS Grade, CONVERT(varchar,
dbo_STU_0001.BD, 101) AS Birthdate, dbo_STU_0001.EC AS Ethnicity,
dbo_MST_0001.PR AS Program, dbo_TCH_0001.TN AS TeacherID, dbo_TCH_0001.TF AS
TchrFirst, dbo_TCH_0001.TLN AS TchrLast, dbo_STU_0001.TG AS LeaveStatus,
dbo_STU_0001.SN AS StudentNumOLD

INTO dbo.vwStudentSchedule_0001

FROM dbo_STU_0001 INNER JOIN dbo_SEC_0001 ON dbo_STU_0001.SC =
dbo_SEC_0001.SC AND dbo_STU_0001.SN = dbo_SEC_0001.SN INNER JOIN
dbo_MST_0001 ON dbo_SEC_0001.SE = dbo_MST_0001.SE AND dbo_SEC_0001.SC =
dbo_MST_0001.SC INNER JOIN dbo_CRS_0001 ON dbo_MST_0001.CN = dbo_CRS_0001.CN
INNER JOIN dbo_TCH_0001 ON dbo_MST_0001.SC =
dbo_TCH_0001.SC AND dbo_MST_0001.TN = dbo_TCH_0001.TN INNER JOIN
dbo_LOC_0001 ON dbo_STU_0001.SC = dbo_LOC_0001.CD

WHERE (dbo_MST_0001.DEL = 0) AND (dbo_CRS_0001.DEL = 0) AND
(dbo_STU_0001.DEL = 0) AND (dbo_TCH_0001.DEL = 0) AND (dbo_SEC_0001.DEL = 0)
AND (dbo_STU_0001.TG = '')

ORDER BY dbo_STU_0001.LN, dbo_STU_0001.FN;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top