Results 1 to 4 of 4
  1. #1
    rd.prasanna is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    25

    Removing Unwanted Spaces From Table Fields, Access 2007

    Hi All,



    I have a concern in IMPORTING data from Excel to Access Table,
    Actually I'am importing bulk data from excel to access table using codes, in which code will auto generate the temptable and uplaod the data to temptable late move required data to the target table.

    My problem is that while creating the temptable im not specifing the lenfg of the fields, cos data is like that, but in target table im getting unwanted extra SPACES after the text, How to get rid of this.

    Thanks in advance
    Prasanna R.D

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Not quite sure I entirely follow your process, but as far as removing extra spaces, both Excel and Access have TRIM functions which will remove blank spaces at the end of any field.

  3. #3
    IslandHydro is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2013
    Location
    Whidbey Island, Washington State, USA
    Posts
    21
    To add to Prasanna's comment, once you've brought data into the temptable, you can use an update query along this lines:

    UPDATE TableName SET TableName.[FieldName] = Trim([FieldName]);

    You can use this type of query on multiple fields, updating the entire table in one step

  4. #4
    DerFarm is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    May 2011
    Posts
    8
    If your entries can have double spaces INSIDE the string you can't use the trim function. You can (I think) invoke a global search and replace after opening the text file under program control.

    In that case, simply replace " " with " ".

    Good Luck

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

Similar Threads

  1. calc field producing unwanted spaces amidst the final string
    By kattatonic1 in forum Database Design
    Replies: 7
    Last Post: 07-12-2013, 10:32 AM
  2. Removing blank spaces created by LEFT statement
    By Paintballlovr in forum Queries
    Replies: 16
    Last Post: 07-09-2013, 12:19 PM
  3. Replies: 1
    Last Post: 04-16-2013, 07:57 PM
  4. Concat in SQL creates unwanted spaces
    By Deutz in forum Access
    Replies: 3
    Last Post: 12-07-2010, 11:43 PM
  5. Replies: 9
    Last Post: 07-16-2009, 09:13 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