Does not contain ISSUE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cephal0n
    New Member
    • Jan 2008
    • 38

    Does not contain ISSUE

    Hi All!

    I have a field named: Title,now I want to filter the data with a specific match.
    In Excel when you set the whole sheet1 to data>filter>aut ofilter, excel offers an Custom AutoFilter window
    where you can select various condition. I noticed that one of the choices is the does not contain option
    I was wondering is this possible to use in sql, aside from LIKE and BETWEEN bec. I'm dealing with long titles and
    would like to include the condition:
    [CODE=SQL]SELECT *
    FROM Table1
    WHERE Table1.Title does not contain = jkl [/CODE]
    thanks in advance!
  • Stewart Ross
    Recognized Expert Moderator Specialist
    • Feb 2008
    • 2545

    #2
    Hi cephal0n. There is more than one way to do this. One way is to use the following negated Like condition:
    [code=SQL]SELECT *
    FROM Table1
    WHERE Table1.Title Not Like "*sometext* "[/code]
    The wildcard characters ("*") are necessary for Like to find the characters anywhere in the string.

    If you wanted to have an Access query which pops up a message box to ask the user what text to exclude you can include a parameter within the query criterion on the Title field:
    Code:
    Not Like "*" & [Enter text to exclude] & "*"
    -Stewart

    Comment

    • cephal0n
      New Member
      • Jan 2008
      • 38

      #3
      hi Stewart!

      Thank you very much for answering! everything seems to make sense now :)

      Comment

      Working...