Not Like OR

tezread

Registered User.
Local time
Today, 19:42
Joined
Jan 26, 2010
Messages
330
Hi thereI am trying to filter out some rows in a query usign the Not Like functionI have Not Like "2. Too late"but when I add OR "1. Ineligible ECG" it still shows up those rows?
 
Think I have itWHERE SomeColumn NOT LIKE "XXX*" AND SomeColumn NOT LIKE "YYY*"
 
try something like this

<>"2. Too late" AND <>"1. Ineligible"

note that including "like" is not necessary if you are testing the full string. Like is valuable when used with * (wild card)
so you could instead just say

not like "*1*" and not like "*2*" - which is OK, as long as none of the other text values include embedded numbers! -


Having to manage complex strings like this is awkward. You would be better just storing the numeric values, so can say

<>1 and <>2, or even just >2

Store the text values for each of these numerics in a lookup table (best) - or even hard code the string equivalents based on the number (but much less flexible). Then you can change the text assocaited with the look up value, easily when you require.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom