Results 1 to 6 of 6
  1. #1
    Sumanth.Ganjam is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2013
    Posts
    9

    Leading Spaces and space after name

    Hi Everyone,

    I am having the table in access database which contains customers name with and without leading spaces and the spaces after customer name.



    Please help me how to find out Leading spaces and spaces after customer name in access Database.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Why don't you do a Find/Replace on the table to remove the leading space?

    In my experience, Access does not retain spaces at end of text
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Sumanth.Ganjam is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2013
    Posts
    9
    Hi,

    Thank you very much for your replay, For me the client requirement is they need to find out the leading spaces.

    When I import excel to access, excel can contain the spaces after customer name how can find out that spaces in Access.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Try a query like:

    SELECT * FROM table WHERE Left([CustomerName],1)=" ";

    or

    SELECT * FROM table WHERE [CustomerName] LIKE " *" OR [CustomerName] Like "* ";

    Are you sure the space after name is there?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Sumanth.Ganjam is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2013
    Posts
    9
    Thank you very much and is working fine.

    Can you please tell me how to Replace the spaces.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    You can use the Find/Replace tool from the ribbon. Basically, have it find all spaces that are at beginning of string and replace with nothing.

    Space at end of string is more difficult but there shouldn't be any, although your experience indicates it is possible and I just read another thread that had the same issue with imported data.

    An UPDATE sql action should actually be able to take care of both.

    UPDATE table SET fieldname=Trim([fieldname])
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 1
    Last Post: 04-16-2013, 07:57 PM
  2. Adding leading spaces to a field
    By johnbr in forum Queries
    Replies: 1
    Last Post: 12-13-2011, 11:31 AM
  3. Replies: 0
    Last Post: 03-29-2011, 10:38 AM
  4. Replies: 9
    Last Post: 07-16-2009, 09:13 PM
  5. Leading Zeroes
    By FREEEEEEDOM in forum Access
    Replies: 2
    Last Post: 04-06-2009, 10:23 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