Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 query dilema

Author  Topic 

lauramayer
Posting Yak Master

152 Posts

Posted - 2007-03-30 : 08:24:41
Morning,

I'm sure this is simple I just can't seem to make it work.

I want it to say show me everyone with who withdrew from a class OR got suspended.

This is what I have:


WHERE m.stu_level = 'UG' --undergraduates
AND (m.rsts_code = 'WC' --withdrawl code
OR s.shrevnt_even_code in ('N14','N15','O16','P25')) --suspension code


Thanks for any help you can provide.

Laura

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-03-30 : 08:27:18
WHERE clause seems fine to me. Post some sample data, expected output and complete query to see what's the problem.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

lauramayer
Posting Yak Master

152 Posts

Posted - 2007-03-30 : 08:49:16
Thanks for that. I found the error. You're right the where clause was correct, it was the join that was wrong.

Thanks

Laura
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-03-30 : 10:09:14
What JOIN?

It'd be easier to debug if we see the whole thing



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -