Results 1 to 3 of 3
  1. #1
    socialc is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2011
    Posts
    1

    Question "Like" Parameter Query - St., St, or Saint?

    I've created an address book database for one of my classes, and one of the requirements is various parameter queries. I chose one to be the ability to view contacts according to the city or town in which they live; however, my professor has suggested I use "Like" criteria, so that a viewer may search either "St. Louis," "St Louis," or "Saint Louis," to view contacts living in STL.



    The proposed solution has been: Like "*"+[Enter City:]+"*" . However, this does not work. I would attempt something like: Like "*" & [Louis] & "*", but this would make the parameter specific to contacts living only in areas with "louis," in the city name.

    Does anyone know of another possible solution?

    Thank-you for your time,

    Cameron

  2. #2
    Access_Blaster is offline User
    Windows XP Access 2010 32bit
    Join Date
    May 2010
    Posts
    339
    have you tried, Like [Enter City] & "*"

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    What's the purpose of the query/exercise?
    If you use like [Enter City] & "*" , what are you searching for.
    Do you have a table of official city/place names? Are you trying to find some specific cities?

    Perhaps you could show us the rest of your query/sql. Without that we are only guessing at what you are trying to do.

    This will find the variation of St Louis
    Like "S*Louis"


    Is there any use to this?
    Code:
    SELECT * FROM Contacts
    WHERE City Like [Enter City] & "*"

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

Similar Threads

  1. "Group By" causes "ODBC--Call Failed" error
    By kaledev in forum Queries
    Replies: 1
    Last Post: 03-09-2011, 02:43 PM
  2. Replies: 7
    Last Post: 01-23-2011, 12:32 PM
  3. Replies: 4
    Last Post: 01-06-2011, 10:52 AM
  4. location of "enter parameter value" box
    By dcjohnso11 in forum Programming
    Replies: 1
    Last Post: 06-25-2010, 11:36 AM
  5. Replies: 0
    Last Post: 03-25-2009, 05:26 AM

Tags for this Thread

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