Microsoft
Software
Hardware
Network
Question : SQL <>
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?
Answer : SQL <>
You need to use AND, not OR. One of both conditions is true if the other is false ...
Random Solutions
SelectedValue which is invalid because it does not exist in the list of items
how can i overcome the problem while connecting to sql server 2005?
Grant to a domain user remote desktop access to only one domain servers
Removing Lines from richtextbox
Moving Profiles from one Terminal Server to another...? How?
Filteroption in Excel2003 pivot table
sql server 2008 clustering prerequisites
How to export public folders to excel
MouseDown Event - Allow or Cancel the click
Automatic Login to Intranet Site using ASP.Net