Results 1 to 6 of 6
  1. #1
    mgarret is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    8

    Removing A Specific Type Of Character From A Field, Access 2010

    Hi all—
    I am trying to write a query in access which will modify these two fields. The leading quote (“) in Child Name and the trailing quote (“) in Participant need to be deleted. So, basically I need all the quotes deleted from these fields. Don’t know how to write for this.

    Any assistance is greatly appreciated. Thanks!

    Example:

    Before:

    Child Name
    "Simth, Joe
    "Simth, Joe
    "Simth, Joe
    "Simth, Joe
    "Jones, Mary
    "Jones, Mary
    "Jones, Mary
    "Jones, Mary
    "Jones, Mary
    "Roberts, Mike
    "Roberts, Mike
    "Roberts, Mike
    "Roberts, Mike

    Participant
    Yes"
    Yes"
    "
    No"
    Yes"
    "
    Yes"
    Yes"
    "
    No"
    Yes"

    After:

    Child Name


    Simth, Joe
    Simth, Joe
    Simth, Joe
    Simth, Joe
    Jones, Mary
    Jones, Mary
    Jones, Mary
    Jones, Mary
    Jones, Mary
    Roberts, Mike
    Roberts, Mike
    Roberts, Mike
    Roberts, Mike

    Participant
    Yes
    Yes

    No
    Yes

    Yes
    Yes

    No
    Yes

  2. #2
    Beetle is offline Unrelatable
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    Camp Swampy (Denver, CO)
    Posts
    207
    Use the Replace function;

    Replace([YourField],"""","")

  3. #3
    mgarret is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    8
    Quote Originally Posted by Beetle View Post
    Use the Replace function;

    Replace([YourField],"""","")
    I tried Replace ([May test.Child Name],""""," ") and Replace([May test.Participant],""""," ")

    It didn't work. all the rows were deleted. What am I missing?

    (May Test is the name of the table.)

  4. #4
    Beetle is offline Unrelatable
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    Camp Swampy (Denver, CO)
    Posts
    207
    Where are you attempting to do this? In a query? In Code?

    More details please.

  5. #5
    mgarret is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    8
    Either a query or sql code.

  6. #6
    Beetle is offline Unrelatable
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    Camp Swampy (Denver, CO)
    Posts
    207
    It didn't work. all the rows were deleted.
    There's no way the Replace function alone deleted rows from your table, so I don't know what you mean by this or what you did, but if you want to update existing rows in a table then the query syntax would look something like the following;

    Update [YourTable] Set [YourField] = Replace([YourField], """", "");

    Notice that's four double quotes then two double quotes. Don't insert a space inside the last set of double quotes unless you actually want to insert a space into the result in place of the existing double quote.

    Do this on a backup copy of your app first, in case you don't get the results you expect.

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

Similar Threads

  1. Replies: 1
    Last Post: 08-06-2012, 11:29 AM
  2. Replies: 2
    Last Post: 08-06-2012, 08:27 AM
  3. Type mismatch Error after upgrading to Access 2010
    By twm07073 in forum Programming
    Replies: 7
    Last Post: 06-13-2012, 10:07 AM
  4. Replies: 1
    Last Post: 06-04-2012, 04:31 PM
  5. Replies: 2
    Last Post: 03-18-2010, 08:24 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