Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Feb 2003
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Not Equal To *Wildard* (2000 SP1)

    I'm having trouble creating a not equal to wildcard search in a query I've created, i.e. I want to return records that don't contain a particular string of information.

    I was able to create an equal to wildcard seardh using Like"*PFPC*" that returns just the records containing "PFPC" in the string. I tried Not Like"*PFPC*", but that didn't work.

    Any suggestions?

    Thanks!

    Scott

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Not Equal To *Wildard* (2000 SP1)

    The condition
    <code>
    Not Like "*FPPC*"
    </code>
    should return all record for which the field does NOT contain FPPC. What goes wrong if you use this condition?

  3. #3
    Star Lounger
    Join Date
    Feb 2003
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Not Equal To *Wildard* (2000 SP1)

    Hi Hans,

    I took a look at it again. What I didn't mention in my original post as that I was doing a the same wildcard search in two different columns. When I used Like"*PFPC*" I placed it in two separate Criteria rows. I thought the same logic applied when using Not; however, when I placed Not Like"*PFPC*" on the same Criteria row under each column, the results were returned correctly.

    Thanks,

    Scott

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Not Equal To *Wildard* (2000 SP1)

    Criteria in the same row are connected by "AND", criteria in different rows by "OR".
    So if you have Like "*PFPC*" in two different rows for two different columns, you are saying that Field1 should contain PFPC or Field2 should contain PFPC (or both).
    If you do the same with Not Like, you are saying that Field1 should not contain PFPC or Field2 should not contain PFPC. So what you're excluding is that both contain PFPC at the same time.
    If you want to specify that neither contains PFPC, you do so by ensuring that Field1 should not contain PFPC and that Field2 should not contain PFPC either - so there you have the AND.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •