Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2010
    Posts
    2

    Lightbulb Unanswered: Replace Query Help

    Hello all.

    I have a table named HitachiMachDesc and I have a column named StandardEquipment within this table. What I am trying to achieve is to remove the line breaks from the fields throughout the whole column.

    If someone would be able to tell me the query to do this it would be much appreciated.

    Jamie.

    P.S. I am an Access n00b

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You could try to create and run an update query such as:
    Code:
    UPDATE HitachiMachDesc SET HitachiMachDesc.StandardEquipment = Replace([StandardEquipment ], Chr(13), " ");
    Depending on how the line breaks are coded (chr(10), chr(13) or both), you'll have to adapt the second parameter of the Replace function.
    Have a nice day!

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    calling a table "HitachiMachineDesc" lets off the slight whiff of suspect table design

    as a one off exercise I suspect you will need to run 3 queries
    UPDATE HitachiMachDesc SET HitachiMachDesc.StandardEquipment = Replace([StandardEquipment ], Chr(13), " ")
    UPDATE HitachiMachDesc SET HitachiMachDesc.StandardEquipment = Replace([StandardEquipment ], Chr(10), " ")
    UPDATE HitachiMachDesc SET HitachiMachDesc.StandardEquipment = Replace([StandardEquipment ], " ", " ")
    one each to replace the special non viewable characters for line feed & carriage return and one to replace two spaces with a single one.

    you could possibly make them one composite query
    UPDATE HitachiMachDesc SET HitachiMachDesc.StandardEquipment = Replace(Replace(Replace([StandardEquipment ], chr(13)" "), Chr(10), " ")," "," ")
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Sep 2010
    Posts
    2
    Thank you Sinndho and healdem both queries seem to work. Much appreciated!

Tags for this Thread

Posting Permissions

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