Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Character in Field as Qry Criteria (2003)

    Is it possible to include in the selection criteria of a query a function to test for a specific character?

    For example, I have a string field (Field1) that may or may not contain a semicolon ";". In my query, I only want records where Field1 does not contain a semicolon in any position. This is probably a simple one, but it goes over my head right now.

    Thanks,

    Ken

  2. #2
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Character in Field as Qry Criteria (2003)

    You can use : Not Like "*;*" as criteria for field 1.
    Regards,
    Rudi

  3. #3
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: Character in Field as Qry Criteria (2003)

    Rudi,

    Thanks for the suggestion. However, the semicolon is within the text and can be anywhere in a 22 character length field. Using the "not like" didn't get there.

    Ken

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

    Re: Character in Field as Qry Criteria (2003)

    You wrote in the first post in this thread that "I only want records where Field1 does not contain a semicolon in any position". Rudi's suggestion
    <code>
    Not Like "*;*"
    </code>
    does exactly that. Check carefully that you entered the condition correctly and in the correct place (in the Criteria line for Field1).

  5. #5
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: Character in Field as Qry Criteria (2003)

    Mia Culpa, it looked like ";" on my puny monitor, which is what I entered. I entered the asterisks and it worked EXACTLY as Rudi suggested.

    THANKS Rudi (and Hans)

    Ken

Posting Permissions

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