troubleshooting Question

SQL <>

Avatar of Mr_Shaw
Mr_Shaw asked on
Microsoft SQL Server 2005Microsoft SQL Server 2008SQL
10 Comments4 Solutions256 ViewsLast Modified:
I am trying to select records where the 3 and forth characters are not equal to N7

Here is my code.
WHERE (LEFT(RIGHT(_Code, 3), 2) <> 'N7'  OR LEFT(RIGHT(_Code, 3), 2)  <>'N8')

It does not work.

I tested
WHERE (LEFT(RIGHT(_Code, 3), 2) <> 'N7' ) and It works.

Why can I not put the N7 and N8 condition next to each other?



Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 4 Answers and 10 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros