Solved

Incorrect syntax near the keyword 'WHERE'

Posted on 2007-12-06
3
174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

Question has a verified solution.

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

Suggested Solutions

In database programming, custom sort order seems to be necessary quite often, at least in my experience and time here at EE. Within the realm of custom sorting is the sorting of numbers and text independently (i.e., treating the numbers as number…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

738 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