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
SQL ORDER BY
Event 10016, DistributedCOM
T SQL Update table.col based on several criteria
How can I allow regular domain users update their own Active DIrectory information?
Add CrLf to a string of text
What permission is needed to edit Logon Script setting in a User's Profile
Microsoft OLE DB Provider for SQL Server error '80040e07'
How to make label in vb.net visual studio 2008 Transparent
Upgrading Server 2008 Evaluation Version to Fully Licensed
VB.net opening text file into DataGridView