By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,052 Members | 1,551 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,052 IT Pros & Developers. It's quick & easy.

I want to retreive student prerequisite for a particular student who wish to take a c

P: 2
Query:

SELECT CP.CoursePrerequisite AS [missing prereq]
FROM CoursePrerequisite AS CP
WHERE (((CP.CourseCode)="EGCE 308")
AND (CP.CoursePrerequisite) NOT IN (SELECT StudentCourse.CourseCode FROM StudentCourse WHERE cwid = 987654321));

This query works fine if student has not completed none of the prerequisite required for the course, however if the student has completed atleast one prerequisite for the course then the query is returning wrong result: it's returning the result set as all the prerequisite for that course.

This query was working fine on SQL SERVER 2016 when I tried it on my Professor's machine, however when I'm trying to run the same query with few modifications it is returning wrong results. I've tried making my ACCESS database ANSI92 compatible but despite that I'm getting wrong results.

Please advise/assist at your earliest as I've a deadline to meet.
Mar 22 '17 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.