none
How to add a text to an existing record in access through query RRS feed

  • Question

  • I need to update a field in Access table through a query by keeping the text in the existing field and insert more text to the same field. I tried update to but it removes the content of the field and adds the new text. I need to keep the existing text.
    Saturday, March 19, 2016 6:01 PM

Answers

  • Let's say your field is named TextField.

    In an update query based on the table, set the 'Update to:' line of the TextField column to

    [TextField] & " text to be added"

    if you want to add the text after the existing text, or to

    "text to be added " & [TextField]

    if you want to add it before the existing text.


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Marked as answer by Heshamko Monday, March 21, 2016 5:55 AM
    Saturday, March 19, 2016 6:29 PM
  • Hi, Heshamko

    To append the text in existing record you can make your query like below given syntax.

    UPDATE [TableName] SET [FieldName] = [FieldName] & 'Appended Text' WHERE [FieldName] = 'Match Record Text';

    & is use to concatenate two strings.

    UPDATE customertbl

    SET lastname = lastname & ‘xyz’

    WHERE firstname = 'abc';

    For more information about update query visit the following link.     

    information regarding update query

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

    • Marked as answer by Heshamko Monday, March 21, 2016 5:56 AM
    Monday, March 21, 2016 2:19 AM
    Moderator

All replies

  • Let's say your field is named TextField.

    In an update query based on the table, set the 'Update to:' line of the TextField column to

    [TextField] & " text to be added"

    if you want to add the text after the existing text, or to

    "text to be added " & [TextField]

    if you want to add it before the existing text.


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Marked as answer by Heshamko Monday, March 21, 2016 5:55 AM
    Saturday, March 19, 2016 6:29 PM
  • Hi, Heshamko

    To append the text in existing record you can make your query like below given syntax.

    UPDATE [TableName] SET [FieldName] = [FieldName] & 'Appended Text' WHERE [FieldName] = 'Match Record Text';

    & is use to concatenate two strings.

    UPDATE customertbl

    SET lastname = lastname & ‘xyz’

    WHERE firstname = 'abc';

    For more information about update query visit the following link.     

    information regarding update query

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

    • Marked as answer by Heshamko Monday, March 21, 2016 5:56 AM
    Monday, March 21, 2016 2:19 AM
    Moderator