Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using LIKE or NOT LIKE ? 1

Status
Not open for further replies.

mulema

Technical User
Nov 16, 2002
32
US
Hi All,
My brain has gone into recess.(I am using version 8.5.)
Problem :
I want to display records where the Notes field <> &quot;*release*&quot; ( ie. Only records where the Notes field doesn't have the word 'release' anywhere in the sentence should be displayed.)

I tried using this formula but got an error message.

NOT ({TableName.Notes}) LIKE &quot;*release*&quot;

How do I get the opposite of NOT LIKE ? or is there a better approach at this?

A typical entry on the Notes field would be &quot;Please release product for shipping&quot;.
The word &quot;release&quot; can be in any position in the sentence depending on how the user composed the sentence. My search on this field showed that some users entered their orders in all upper cases, such that I could be searching for 'release', 'Release', or 'RELEASE'.

Thanks for your assistance.
 
Mulema,

NOT ({TableName.Notes}) LIKE &quot;*release*&quot;

At first glance, that looks OK to me. However, if you are getting an error message, I suggest you try putting the part after the NOT in parentheses, like so:

NOT ( ({TableName.Notes}) LIKE &quot;*release*&quot; )

Alternatively, try:

(({TableName.Notes}) LIKE &quot;*release*&quot; ) = false

If that still doesn't work, perhaps you could tell us what the error message is.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Mike, Thanks for your quick response.
The error was as a result of my position of my parenthesis

This is what I came up with.

( NOT ({TABLE.NOTES} LIKE '*released*' ) OR
NOT ({TABLE.NOTES} LIKE '*Released*' ) OR
NOT ({TABLE.NOTES} LIKE '*RELEASED*' ))

Thanks for refreshing my sleeping brains.

Mulema.
 
a simpler way of doing that would be

NOT (ucase({TABLE.NOTES}) LIKE '*RELEASED*' )

now you can handle any upper/lower case combination.

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top