Results 1 to 2 of 2
  1. #1
    garygoodguy is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    4

    TRIM not removing leading spaces in Query expression

    Hi, I have imported an excel sheet into an Access table. The excel doc came from a DSS system so there are leading spaces in the first text column. In excel, to remove the spaces the only formula that works is: =TRIM(TRIM(SUBSTITUTE(A5,CHAR(160),""))).

    Back in Access now, and in a query I've tried TRIM and LTRIM to remove leading spaces but this does not work. I have a feeling it could be REPLACE, but does anyone know how I can replicate the excel formula in Access to remove the leading spaces in my query expression?



    Thanks in advance.

  2. #2
    garygoodguy is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    4
    Hi, sorry I figured it out. Didn't realise I had to replace 'Substitute' with 'Replace' and 'CHAR' with 'CHR'.
    The rest of the formula is the same and works.

    Thanks anyway.

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

Similar Threads

  1. Replies: 2
    Last Post: 11-20-2012, 03:21 AM
  2. Adding leading spaces to a field
    By johnbr in forum Queries
    Replies: 1
    Last Post: 12-13-2011, 11:31 AM
  3. how to trim text in a column using sql query of ms access
    By learning_graccess in forum Access
    Replies: 4
    Last Post: 12-05-2011, 07:15 AM
  4. Replies: 2
    Last Post: 11-04-2011, 09:14 AM
  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