Results 1 to 4 of 4
  1. #1
    kwalt is offline Novice
    Windows XP Access 2000
    Join Date
    Feb 2009
    Posts
    3

    LIKE query


    i have a database of businesses with their names and addresses.

    i am trying to pull all the businesses that end in 's, for example: charlie's pizza, jim's auto, jane's towing ect....

    im using this code

    select business_name
    from obd
    like '%'S'
    ;

    i receive and error. what code should i use to only select business names that end in 's

    Thanks

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    SELECT business_name
    FROM obd
    WHERE business_name Like "*'s*";

    what that does is look for the string "'s" anywhere in the business_name and pulls it. you mentioned you wanted all businesses that end in 's but thats not really what you want as none of the examples you gave actually end in 's. You're looking for 's to be part of the name.

  3. #3
    ConneXionLost's Avatar
    ConneXionLost is offline Simulacrum
    Windows XP Access 2003
    Join Date
    Jan 2010
    Location
    Victoria, Canada
    Posts
    291
    Try this:

    Code:
    SELECT business_name
    FROM obd
    WHERE business_name Like "*'s*";
    Cheers,

  4. #4
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    connexion, fixed my post right as you mentioned it, thanks for the backup =]

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums