+ Reply to Thread
Results 1 to 3 of 3

Thread: Use of LIKE operator in a query asking for an input

  1. #1
    Registered User
    Join Date
    09-21-2010
    Location
    Rome, Italy
    MS-Off Ver
    Excel 2003
    Posts
    12

    Use of LIKE operator in a query asking for an input

    I'm new to Access and I'm working with queries.
    What I'm trying to do is a query which asks for a criteria when run (i.e. using "[]") for a field type "string": using the "LIKE" operator, it would be possible to input only the first "n" characters, obtaining all the records in which the searched field starts with those "n" characters.

    To be clearer: searching a field CustomerID, containing "Romoluzzi" and "Romoli", I want that my query asks me "Customer?" and after my input of "Romo", I get both the records with Romoluzzi and Romoli.
    The query is unique, the criteria LIKE must be in the "[]", because it can be different at every run ("Romo" is not fixed).

    I thank in advance everyone helping me.
    Last edited by Romoluzzi; 01-08-2011 at 07:49 AM.

  2. #2
    Valued Forum Contributor alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Lake County, Illinois
    MS-Off Ver
    MS Office 2010, 2007 and 2002
    Posts
    1,161

    Re: Use of LIKE operator in a query asking for an input

    In your criteria type:

    Like [Enter the first couple of letters of your parameter here] & "*"
    Good Luck
    Alan

  3. #3
    Registered User
    Join Date
    09-21-2010
    Location
    Rome, Italy
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Use of LIKE operator in a query asking for an input

    Thank you so much for your prompt and useful help!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0