Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2003
    Posts
    11

    Unanswered: Parameter Query and 'LIKE' SQL

    I am using Access 2000, and am trying to create a query that will search for all of the records that have a certain last name. The Name field is formatted "Smith, John and Virginia". The user should be able to enter the last name they would like to search for.

    I've created a parameter query that prompts for the last name (the parameter name is lastname), but I'm not sure how to make it work in the SQL statement I've setup:

    SELECT * FROM TABLE WHERE Name Like '[lastname]*';

    Access doesn't search for the parameter but the string [lastname]. Any ideas?

    Thanks,
    Rebecca

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1

    Talking Wildcard searches

    Anything within the quotes is a literal string, so concatenate your parameter with the wildcard:

    WHERE Name Like [LastName] & "*";

Posting Permissions

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