Solved

Incorrect syntax near the keyword 'WHERE'

Posted on 2007-12-06
3
172 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Server - Set Value of Multiple Fields in One Query 10 26
sql query to calculate avaerage 21 53
VB.net and sql server 4 45
How to count the days a record spends in a step 21 51
Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

820 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