Results 1 to 10 of 10
  1. #1
    4 Star Lounger
    Join Date
    Jul 2006
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Not like Statement working (2003)

    I am unable to get the 'Not Like' statement working so that the query excludes the row with line with the CR # 1042447 (i.e. highlighted in black). See attachments for details.

    I don't mind want is used in the query as long as this line is not included in query.
    It is not possible to simply remove this row as this is not an option.
    Attached Files Attached Files

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    3 Star Lounger
    Join Date
    Jun 2001
    Location
    Salem, Oregon, USA
    Posts
    219
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Not like Statement working (2003)

    So that those of us who don't open attachments can help, can you paste a simplified version of your query to show what you are trying to do to attain the goal of excluding that line?
    thx
    Pat

  4. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Not like Statement working (2003)

    Your query has "not Like "*EVPN*" , but the row you want to exclude does not contain EVPN.

    Can you explain what you are trying to do?
    Regards
    John



  5. #4
    4 Star Lounger
    Join Date
    Jul 2006
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Not like Statement working (2003)

    Hello,

    what l am trying to do is to remove the row that contains the words :

    CR # 1042447

    Nothing more nothing less. All other rows are to be left, it is just that row which l need to exclude in the query. I hope that makes things a bit clearer

  6. #5
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Not like Statement working (2003)

    Hi, add the following criteria to the CR # field:
    Str([CR #]) Not Like "*1042447*"

  7. #6
    4 Star Lounger
    Join Date
    Jul 2006
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Not like Statement working (2003)

    I tried making that change but now appear to get an error, see attached.
    Attached Images Attached Images

  8. #7
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Not like Statement working (2003)

    Replace Str([CR #]) Not Like "*1042447*"
    with Str([CR#]) Not Like "*1042447*"

    i.e. remove the space between CR and # the field name does not have a space in it.

    Is the CR# field a number?

    If so you could just put <>1042447 on the criteria line instead.
    Regards
    John



  9. #8
    4 Star Lounger
    Join Date
    Jul 2006
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Not like Statement working (2003)

    Hello,

    This does not work either , as not it returns lots of results!!

    But should only return 4 results, see attachment for details.
    Attached Files Attached Files

  10. #9
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Not like Statement working (2003)

    I don't know how but this criterion has ended up on the third row rather than the second.
    Do you stll need the "not like "*EVPN*" in there?
    Attached Images Attached Images
    Regards
    John



  11. #10
    4 Star Lounger
    Join Date
    Jul 2006
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Not like Statement working (2003)

    that works great thanks

Posting Permissions

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