Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2004
    Location
    Emmen, The Netherlands
    Posts
    8

    Unanswered: Replace different things in string

    Hi ppl,

    I have a field in my table with up to 10 abbreviations. I want to change all of those to complete words.
    I have a table with 2 columns, the abbreviations and the complete words.
    How should my Update query look when I want to change the stuff in to complete words.
    I thinked about making different update queries for all the abbreviations, but there are over 25. It's just not an option.

    L8r

  2. #2
    Join Date
    Sep 2004
    Location
    Reston, VA
    Posts
    86
    Can you clarify a little bit - Do you have up to 10 abbreviations in the same field? Or one abbreviation per record? The solution will be different depending on your exact data setup.

  3. #3
    Join Date
    Oct 2004
    Location
    Emmen, The Netherlands
    Posts
    8
    Up to 10 in the same field.

  4. #4
    Join Date
    Sep 2004
    Location
    Reston, VA
    Posts
    86
    Try this Update query and replace the following with your own table/field names:

    tbl_Abbrev = table with your abbreivations and their long text
    tbl_Text = table with field full of abbreviations
    [TEXT] = field full of abbreviations
    [ABBREVIATION] = abbreviation from tbl_Abbrev
    [FULL_TEXT] = full text of abbreviation from tbl_Abbrev

    UPDATE tbl_Abbrev, tbl_Text SET [tbl_Text].[TEXT] = Replace([TEXT],[ABBREVIATION],[FULL_TEXT])
    WHERE (((InStr(1,[TEXT],[ABBREVIATION]))>0));


    Of course, be sure to make a backup copy of your table before updating it.

  5. #5
    Join Date
    Oct 2004
    Location
    Emmen, The Netherlands
    Posts
    8
    WOW.
    Thanks for the quick sollution!
    Well, I hope this is the right sollution, I'll test it right away. (Bweegh, I'm tired...)

  6. #6
    Join Date
    Oct 2004
    Location
    Emmen, The Netherlands
    Posts
    8
    Well. It worked. That was easy!
    Thanks a lot!

  7. #7
    Join Date
    Sep 2004
    Location
    Reston, VA
    Posts
    86
    No problem. Enjoy your new table.

Posting Permissions

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