Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove leading space

Status
Not open for further replies.

mystuff

Programmer
Apr 30, 2004
86
US
I am trying to use a query to remove leading spaces. I tried to use the TRIM command but it does not seem to do anything.

The field name that I am trying to trim is: [Product Name]

When I put the following in the column of a select query, I still have the leading space.

NewProductName:Trim([Product Name])

Any ideas?
 
Trim() works on both sides so maybe it is not a space there. It could be a non-displayable character. Highlight the leading "space" from one of the affected fields and then copy/paste it into Word and turn on the "show hidden characters" option.
 
JonFer, you were absolutely right, it was not a space. Thanks alot!
 
You can use a built-in function to check a single character's ASCII code. If you want to check every character in a string, you should write your own function.

Somewhere in Access help is the ASCII table so you can determine what's what.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top