Solved

Incorrect syntax near the keyword 'WHERE'

Posted on 2007-12-06
3
165 Views
Last Modified: 2010-03-20
I'm just not seeing it...probably because I have a headhache:


SELECT	st.iStudentID,

			clp.iProjectID,

			clp.vchTitle,

			cpop.iClassProjectID,

			cl.siLessonNumber,

			st.vchUserName,

			st.vchFirstName,

			st.vchLastName,

			st.bEnabled,

			cse.iClassEnrollID

	FROM Student st (nolock)

		JOIN Class_StudentEnroll cse

		JOIN Student_Program sp ON sp.iStudentID = st.iStudentID

		JOIN vClassProgramOutcomeProjects cpop ON cpop.iProgramID = sp.iProgramID

		JOIN ClassLessonProject clp ON clp.iProjectID = clgp.iClassItemID

		JOIN ClassLesson cl ON cl.iClassLessonID = clp.iClassLessonID

		JOIN classGradePoint clgp ON clp.iClassLessonID = cl.iClassLessonID

		JOIN ClassLessonProject clp ON clp.iProjectID = clgp.iClassItemID

	WHERE ((cse.chLetterGrade IS NULL) OR (cse.chLetterGrade <> 'EW'))

		AND cse.bWithdrawn = 0

		AND cse.chEnrollType = 'STU'

		AND cse.iClassID = 9482

Open in new window

0
Comment
Question by:dba123
  • 2
3 Comments
 
LVL 25

Accepted Solution

by:
imitchie earned 250 total points
ID: 20423219
SELECT  st.iStudentID,
                        clp.iProjectID,
                        clp.vchTitle,
                        cpop.iClassProjectID,
                        cl.siLessonNumber,
                        st.vchUserName,
                        st.vchFirstName,
                        st.vchLastName,
                        st.bEnabled,
                        cse.iClassEnrollID
        FROM Student st (nolock)
                JOIN Class_StudentEnroll cse   ------- join condition needed here
                JOIN Student_Program sp ON sp.iStudentID = st.iStudentID
                JOIN vClassProgramOutcomeProjects cpop ON cpop.iProgramID = sp.iProgramID
                JOIN ClassLessonProject clp ON clp.iProjectID = clgp.iClassItemID
                JOIN ClassLesson cl ON cl.iClassLessonID = clp.iClassLessonID
                JOIN classGradePoint clgp ON clp.iClassLessonID = cl.iClassLessonID
                JOIN ClassLessonProject clp ON clp.iProjectID = clgp.iClassItemID
        WHERE ((cse.chLetterGrade IS NULL) OR (cse.chLetterGrade <> 'EW'))
                AND cse.bWithdrawn = 0
                AND cse.chEnrollType = 'STU'
                AND cse.iClassID = 9482
0
 
LVL 25

Expert Comment

by:imitchie
ID: 20423220
check the ----- line above ^^^
0
 
LVL 1

Author Comment

by:dba123
ID: 20423226
crap...thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now