Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2004
    Posts
    43

    Unanswered: Query -By Letter

    Simple one for you experts out there!

    I wish to write a query of contact information -Obviously the user will have a parameter to enter-at the moment i have it set up where by the user would have to enter the clients full name to access their details eg)

    Claire -would have to be entered for Claire

    I want it so that:-

    The user merely has to enter a letter that the name starts with(in this case C) and will then get all the clients names that begin with C as results.

    Obviously i wish this to happen from A through to Z as well.

    I know the use of a wildcard will be needed -but am not 100% sure how.

    Thanks in advance.

  2. #2
    Join Date
    Feb 2004
    Posts
    43
    This is the code i am using-which isnt throwing up any results!

    WHERE ((([contact details].Contact)=[Enter a Name] Or ([contact details].Contact) Like "[ABCD]%"));

  3. #3
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    Hi,

    Select *
    from table
    where columm LIKE ""&[param]&"*"
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  4. #4
    Join Date
    Feb 2004
    Posts
    43

    Many Thanks-But........

    That has worked a treat-except i get asked twice for a Name, how should i alter the string below-so that i get the same results-but dont have to input a parameter twice.

    WHERE ((([contact details].Contact)=[Enter a Name] Or ([contact details].Contact) LIKE ""&[Name]&"*"));


    (Thanks again)

  5. #5
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    You do not need to have LIKE 'X' and = 'X' as LIKE 'X' will return all results that ='X' will return.

    Therefore, your query should be:

    ...
    WHERE [contact details].Contact LIKE ""&[Name]&"*";
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  6. #6
    Join Date
    Feb 2004
    Posts
    43
    Youre a star-i didnt want to have it done for me-but as i tried and failed it was the only way.

    Many Thanks

Posting Permissions

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