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

Hide last 5 characters of a string

Status
Not open for further replies.

jcg6

Technical User
Feb 18, 2002
50
US
I would like to hide the last 5 characters of a field in a report. I have been playing with the LEN, MID, RIGHT, LEFT funtions, but can't come up with the right combination.

Does anyone have an example of how I would do this?

Ex: 123456789 would print 1234 and leave off the 56789

Any guidance would be most appreciated. Thanks.
 
You could do this:

=left$(StringName,len(StringName) - (len(StringName)-5))
 
Just a "Len" too many, hneal:
=left(StringName,len(StringName) - 5)
;-)
 
THANK YOU ALL!!! That is exactly what I needed to know!! :)
 
Sorry, that extra len would be if you wanted to see the last characters.
 
Ah! Yeah, right.

P.S: I always used Left and Right functions for all sorts of string manipulations until I learned to esteem the simplicity of the mid function in these fora:
e.g. Mid(string,len(string)-5) will perform the exact same thing, i.e. return only the last 5 characters.

Was it xlbo or dyarwood I learned this from? I don't remember... ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top