Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Shetland Isles, Shetland, Scotland
    Posts
    154
    Thanks
    3
    Thanked 1 Time in 1 Post
    Hi,

    In the criteria of a query, how do I find a string that contains a percentage sign?

    Obviously % doesn't work but I thought that Like * & "%" & * would.

    As an example, one of the strings I'd like to find is "APT&C FT PO1-4 SCP 37 - 7.5% R"


    Thanks
    Jim MacLeod
    Shetland Isles

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

    Like "*%*"

    This assumes that you use the default Access SQL syntax, not SQL Server compatible syntax (ANSI 92).

  3. #3
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Shetland Isles, Shetland, Scotland
    Posts
    154
    Thanks
    3
    Thanked 1 Time in 1 Post
    [quote name='HansV' post='798972' date='20-Oct-2009 11:34']Try

    Like "*%*"

    This assumes that you use the default Access SQL syntax, not SQL Server compatible syntax (ANSI 92).[/quote]

    Thanks, I tried that but it returns all results.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Could you attach a stripped down and zipped copy of the database?

  5. #5
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts
    [quote name='jmacleod' post='798974' date='20-Oct-2009 05:37']Thanks, I tried that but it returns all results.[/quote]
    Try this syntax:
    Like "*[%]*"
    It would also help to know which version of Access you are using. (We visited your fair islands a few years ago - a beautiful place even if the wind does blow!)
    Wendell

  6. #6
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Shetland Isles, Shetland, Scotland
    Posts
    154
    Thanks
    3
    Thanked 1 Time in 1 Post
    [quote name='WendellB' post='798982' date='20-Oct-2009 13:14']Try this syntax:
    Like "*[%]*"
    It would also help to know which version of Access you are using. (We visited your fair islands a few years ago - a beautiful place even if the wind does blow!)[/quote]

    Thanks, the square brackets worked!

    Glad you enjoyed our Islands, get in touch if you're here again! You're right, it does blow here, we trying to get a really big windfarm built here just now.

Posting Permissions

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