[thelist] SQL: Like 'S%', but not like '%safety%'

Peter Brunone (EasyListBox.com) peter at easylistbox.com
Wed Jan 19 09:48:06 CST 2005


Hi Rob,

	If you're going to do it this way, you need an AND in your
second subclause.

...and ((o.PONumber like 'C%'  OR o.PONumber like 'S%') and (not
o.PONumber like '%safety%' AND not o.PONumber  like '%saftey%')) ORDER
BY ...

	The way you had it, you wanted something that was not 'safety'
(which is true of 'saftey') OR something that was not 'saftey' (which is
true of 'safety').

Cheers,

Peter

-----Original Message-----
From: thelist-bounces-evolt=easylistbox.com at lists.evolt.org On Behalf Of
Rob Smith

Howdy,

I'm trying this simple simple SQL query, but for some odd reason, it's
not working. The subject line is pretty much it. Specifically:

...and ((o.PONumber like 'C%'  OR o.PONumber like 'S%') and (not
o.PONumber like '%safety%' or not o.PONumber  like '%saftey%')) ORDER BY
...

I want to pull up PO's that begin with 'C%' or 'S%', but at the same
time, it's also pulling up PO's with the word Safety (and the misspelled
variety of Saftey). 

Any ideas?

Rob Smith





More information about the thelist mailing list