Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    May 2002
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Queries & Wildcards (Access 2002)

    Is there a way in the Access Query design view Criteria cell that one can use a wildcard with a letter or two. For example, if you want the dynaset from a query to show those people who's last name begins with Sm (Smith, Smithers, Smythe), what syntax in the criteria cell do you use? Sm*, or Sm** doesn't work. Thanks in advance for any help.

  2. #2
    New Lounger
    Join Date
    Oct 2002
    Location
    Chattanooga, Tennessee, USA
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Queries & Wildcards (Access 2002)

    In your criteria us the follwoing syntax:

    Like "sm*"

    or better yet:

    Like [Enter First few characters] & "*"

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Queries & Wildcards (Access 2002)

    Expanding on Jerry's comments, there is a single character wildcard of Question Mark which you can use to match situations like you describe. So to get your example to work, the criteria would be:
    <font color=blue>Like "Sm?th*"</font color=blue>
    Wendell

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Queries & Wildcards (Access 2002)

    Is the last name at the start of a field, or is it embedded inside the field?
    If embedded inside the field you will need the following:

    Like "*sm*"

    Pat <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  5. #5
    2 Star Lounger
    Join Date
    May 2002
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Queries & Wildcards (Access 2002)

    Thanks all for your input. It appears the answer that works best is Jerry's parameter query criteria: Like [Enter First few characters] & "*". Works like a charm although I thought there'd be some syntax a little shorter. Thanks again Jerry.

  6. #6
    New Lounger
    Join Date
    Oct 2002
    Location
    Chattanooga, Tennessee, USA
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Queries & Wildcards (Access 2002)

    You're welcome.

Posting Permissions

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