Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 341
  • Last Modified:

NOT LIKE Command?

Is there a NOT LIKE command for SQL? I'm trying to do a report on our ISA server log but I don't want to see anything for www.weatherbug.com When I do a comamnd like this

SELECT DISTINCT ClientUserName, logTime, DestHost
FROM         dbo.[Test Lab]
WHERE     (DestHost LIKE '%weatherbug.com') OR
                      (DestHost LIKE '%wxbug.com')


I get only the weatherbug items. When I throw a NOT in front of LIKEI still get the weather bug Items. Any ideas?
0
t1clausen
Asked:
t1clausen
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
to negate, you have ALSO to negate the OR, hence put a AND:

SELECT DISTINCT ClientUserName, logTime, DestHost
FROM         dbo.[Test Lab]
WHERE     (DestHost NOT LIKE '%weatherbug.com') AND
                      (DestHost NOT LIKE '%wxbug.com')
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now