#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2008
    Posts
    20
    Rep Power
    0

    Extracting letters


    Hi all,

    I hope this'll be a nice and easy one.

    I have a list of names e.g.

    Ann Marie
    Anthony/Anne Marie
    James Norman/Paul John
    David Shaun Jonathan

    I want to make a new field that looks like this for each of the above:

    Ann Marie, A M
    Anthony/Anne Marie, A/A M
    James Norman/Paul John, J N/P N
    David Shaun Jonathan, D J S

    I want this to be suited for any length of name so even if someone had seventy-two names, all seventy-two initials would be put into the new field.

    I think this means I'll need a code as opposed to a simple query to make this field, thing is I no next to nothing about Access code.

    Anyone know of a code can use and how I set it up to make my new field?
  2. #2
  3. Business Analyst
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Mar 2004
    Location
    The 'Ville
    Posts
    1,087
    Rep Power
    27
    I think you'll want to use character functions to do this and it can be done without any front end - should be able to achieve this just through SQL (maybe using a cursor). What DBMS are you using? I primarily use Oracle. There are functions for SUBSTR (get part of a string), REPLACE, TRIM, etc. Start there...

    Comments on this post

    • jzd agrees
    Discontent is the first necessity of progress. - Edison
  4. #3
  5. Business Analyst
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Mar 2004
    Location
    The 'Ville
    Posts
    1,087
    Rep Power
    27
    Also, it may be best to create separate fields rather than just trying to create a single query. Maybe you create a first_name, last_name, first_initial and last_initial column. Then you can concatenate as needed.
    Discontent is the first necessity of progress. - Edison

IMN logo majestic logo threadwatch logo seochat tools logo