Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2004
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Wildcard in Access DB

    Can somebody tell me what's wrong with my query?

    SELECT main_table.FirstName
    FROM main_table
    WHERE main_table.FirstName= "%ann%";

    I have the following firstnames: Jacqui-ann, Anna, Anne, James, and Sarah.
    I'm supposed to get back the first three names, correct? I'm doing this in MS Access and my results are zero. I don't see anything wrong with my query and I've used the design view and the help guides, but still no results. Is it different in Access or something? I'm not getting errors though. Thanks.

  • #2
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts
    It has been a while since I used MS Access...so...not sure if this would work or not....

    Code:
    SELECT main_table.FirstName
    FROM main_table
    WHERE (((main_table.FirstName) Like "*nn*"));
    good luck.
    Ess

  • #3
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,092
    Thanks
    2
    Thanked 23 Times in 23 Posts
    This should work:

    Code:
    SELECT main_table.FirstName
    FROM main_table
    WHERE main_table.FirstName Like '%nn%'
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!


  •  

    Posting Permissions

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