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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cAN DATA IN A TABLE BE "TRIMMED" FROM THE RIGHT OR LEFT?

Status
Not open for further replies.

dunnjt

Technical User
Nov 20, 2001
64
US
Data in a field in a table has some "excess" characters. The characters are not identical in each field but the "excess" characters are preceded by a pound sign. Can I ask Access to trim away all those unwanted characters after the pound sign? How?
I am not a code writer but I think there might be a function, macro or property that will accomplish this task. However, I am having no success finding a solution.
Thanks for any suggesttions
Have a pleasant Thursday,
Jerry D.
 
Use the Instr() function to find the position of the £ sign then the Left() function to get the characters before it:
Code:
strTest = "abcd£efg"
lngPos = InStr(strTest, "£")
strTrim = Left$(strTest, lngPos - 1)

Geoff Franklin
 
If you are using code rather than the query window then I would use the Split() function.

Hope this helps

HarleyQuinn
---------------------------------
Help us to help you,
read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top