Need to remove spaces from field in table (1 Viewer)

davidg47

Registered User.
Local time
Today, 17:18
Joined
Jan 6, 2003
Messages
59
I have a table that for some reason when I imported the data, placed some spaces before about 75% of the numbers in only one column. I need these numbers to be exactly the same as in another table because I use this number to compare to records and import other data depending on the corresponding numbers.

I tried doing a find and replace, but for some reason it doesn't find the spaces to replace. If I type in the space and the number, then in the replace with type only the number, it works. But I cannot do that since there are literally 10's of thousands of different numbers.

Someone mentioned a "LTRIM" command. Does this work within Access and if so, how does it work?

Thanks,
David
 
Last edited:

RuralGuy

AWF VIP
Local time
Today, 15:18
Joined
Jul 2, 2005
Messages
13,826
Use an UPDATE query
"UPDATE YourTableName SET YourField = Trim([YourField]);"

Will remove leading and trailing spaces.
 

KeithG

AWF VIP
Local time
Today, 14:18
Joined
Mar 23, 2006
Messages
2,592
The Trim function will remove any blank characters from the begining or end of your string.
 

davidg47

Registered User.
Local time
Today, 17:18
Joined
Jan 6, 2003
Messages
59
Worked perfect guys!!! Thanks!!! Actually I only had to use the "ltrim" command to move the numbers to the left justify position.
 

Users who are viewing this thread

Top Bottom