SQL help

I want to make sub description 3 say NOT SALE where it Does not contain S

My SQL knowledge is basic. I can do: UPDATE item

set subdescription3 = 'NOT SALE'

where subdescription3 = ''

Which will make it correct for blank items, but I don't know how to do any kind of Not command?

Please help.

Chris

Reply to
chris allsopp
Loading thread data ...

See if this gets you the rows you are looking for:

Select itemlookupcode, description, subdescription3 from item where subdescription3 NOT LIKE '%S%'

% is the wild card for SQL - kind of like * in most other contexts.

Glenn Adams Tiber Creek C> I want to make sub description 3 say NOT SALE where it Does not contain S >

Reply to
Glenn Adams [MVP - Retail Mgmt]

Here are a couple of SQL tutorial & reference sites:

formatting link
formatting link
formatting link
You can use NOT in an SQL statement.

If you have doubts about yoru query, use SELECT instead of UPDATE. Once the SELECT query returns the right results, change it to update and away you go.

Backup your database!

Tom

Reply to
Terrible Tom

Use the operator instead of To see what records would be affected, first do:

SELECT * from item where subdescription3 ''

UPDATE item set subdescription3 = 'NOT SALE' where subdescription3 ''

Reply to
Jason

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.