Results 1 to 3 of 3
  1. #1
    alinapotter is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    11

    update query that removes extra spaces in the sentence

    I am totally lost. I have a Sentence field that contains sentences with extra spaces in the middle and before tbe period.


    For example: I need to buy a new compu ter this month. (3 spaces)
    This book is about Fre nch Revolution. (3 spaces)
    Lets go to the lake tomorrow . (4 spaces before period)

    I need to create an update query which removes extra spaces before the period and create another query which removes 3 spaces in the middle.

    First, I run this: Replace([Sentence]," ","") and it removes 3 spaces in the middle and 3 spaces before the period. BUT I am still left with an extra space before the period. What should I do?

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    replace([Sentence], " .", ".")

    would work wouldn't it? if you've got 3 spaces before the period

    replace([Sentence], " .", ".")

    if you've got 4 spaces before the period

    or you can run a secondary update after you run your first one to just replace anything with a space period

    replace([Sentence], " .", ".")

  3. #3
    alinapotter is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    11
    Thanks, it worked

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

Similar Threads

  1. update query that removes extra letters
    By alinapotter in forum Queries
    Replies: 4
    Last Post: 04-06-2013, 01:15 PM
  2. Query. Extra column.
    By seweryng in forum Queries
    Replies: 1
    Last Post: 01-14-2011, 08:59 AM
  3. Adding table to Query removes every 4th record
    By CoachBarker in forum Queries
    Replies: 1
    Last Post: 10-13-2010, 07:23 AM
  4. Replies: 3
    Last Post: 05-19-2010, 10:08 PM
  5. Extra date field update
    By georgft in forum Forms
    Replies: 0
    Last Post: 09-17-2008, 06:51 AM

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