Results 1 to 4 of 4
  1. #1
    btappan is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2013
    Posts
    43

    Remove data from text field that has matching data in another field

    I have a table with data like what I have below that I am trying to clean up, where some lines have the brand or SKU, or sometimes both, mixed in with the description. I'd like some sort of function that says if the brand name is repeated in the description, to remove it from the description text. Same for if the SKU is repeated in the description. Addressing the left behind white space would be good too.

    Brand|SKU#|Description
    XYZ|123|XYZ 123 SHOCK DAMPER
    ABC|456|ABC 456 WIPER ARM


    QRS|789|OIL FILTER
    JKL|888|888 TIRE
    HIJ|999|HIJ LAMP

    Desired outcome:
    XYZ|123|SHOCK DAMPER
    ABC|456|WIPER ARM
    QRS|789|FILTER
    JKL|888|TIRE
    HIJ|999|LAMP

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Try something like Clean_Description:Trim(Replace(Trim(Replace([Description],[Brand],""),[SKU#],"")) in a select query first and if your happy with the results use an update query to clean the data.

    Cheers,
    Vlad

  3. #3
    btappan is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2013
    Posts
    43
    Once I realized it was missing a right side parenthesis it worked like a charm, thanks! Had to change to Trim(Replace(Trim(Replace([Description],[Brand],"")),[SKU#],""))

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Glad to hear, sorry, I've just free-typed it...

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Remove Field Labels where data is blank, null, etc.
    By DecaturLady in forum Reports
    Replies: 9
    Last Post: 11-21-2017, 02:41 PM
  2. Replies: 1
    Last Post: 08-08-2015, 10:34 AM
  3. Remove data if field value is zero
    By tombarberio in forum Queries
    Replies: 6
    Last Post: 10-28-2014, 04:45 PM
  4. Using search field to find matching data
    By rthakral in forum Access
    Replies: 2
    Last Post: 08-19-2013, 12:18 PM
  5. Replies: 9
    Last Post: 06-28-2012, 10:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums