DB Query, filter on "NOT"

2 posts / 0 new
Last post
Offline
Joined: 04/01/2013 - 3:48pm
DB Query, filter on "NOT"

I am having difficulty using DB Query to filter records based on a value NOT being something. For example, WORK PKG<>'POWER'. Syntax <>' ' works fine for finding records where the field value is not blank. But I need help with how to set it up for a value or a value with a wildcard. Thank you.

Offline
Joined: 05/31/2012 - 9:19am

The <>'' (pronounced 'Not Equal to Blank') is useful when omitting any records that do not have a value in a certain field.  To elimate a value specifically, or a value with wildcards embedded use 'Not Like' instead.  For instance, if you wanted to import all cables except for those that were labeled as a level indicating transmitter, the text box in DbQuery would read something like:

NOT LIKE '*LIT*'

Notice, the wild cards and the value are enclosed in single quotation marks.  
To eliminate a specific value use:

NOT LIKE 'POWER'

GSN Tech

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.