Results 1 to 5 of 5
  1. #1
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    243

    Replace ` with ' in all data in a specific field

    Hi,


    I have a database and I notice in some of the data I have the (`) instead of (') .
    Example: a record shows: farmer`s house while ti should be farmer's house.
    I used the following code to identify these records:
    Code:
    SELECT tblBooks.BookTitle
    FROM tblBooks
    WHERE (((tblBooks.BookTitle) Like "*`*"));
    I am trying to use an update query to replace the (`) with (') in these 159 records. Note that the filed data might have more than one (`) in ti.
    I tried the following code that gave an error.
    Code:
    UPDATE tblBooks
    SET BookTitle=REPLACE(BookTitle, '`',''')
    WHERE BookTitle like "*`*";
    I am having an error.
    Any suggestions?

    Khalil

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,945
    You can use " ?
    Code:
    tt = "this is ~ a test"
    tt=replace(tt,"~","#")
    ? tt
    this is # a test
    In fact that is what I normally use?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    try

    WHERE instr(BookTitle,"`")>0

  4. #4
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    243
    Hi,
    Thank you.
    Mission accomplished.

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    for the benefit of others who have the same sort of problem - please can you post your solution

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

Similar Threads

  1. Replace Data Where Field is not blank
    By tcheck in forum Programming
    Replies: 2
    Last Post: 10-31-2016, 10:37 AM
  2. Replies: 1
    Last Post: 07-01-2016, 08:24 AM
  3. Replies: 1
    Last Post: 05-31-2015, 09:20 AM
  4. Replies: 1
    Last Post: 04-24-2014, 06:31 AM
  5. Replies: 7
    Last Post: 12-11-2009, 01:44 AM

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
  •  
Other Forums: Microsoft Office Forums