Remove first 7 digits from a field

1976
3
09-20-2011 10:54 AM
SeanKroencke
New Contributor
I'm trying to run a Field Calculator on a field to simply remove the first 7 digits of the field. How do I do this?

Thanks
0 Kudos
3 Replies
DarrenWiens2
MVP Honored Contributor
VBScript: use a combination of CStr (to convert your number to a string), Len (to get the total number of characters), and Right (to grab only characters at the right hand end of your string [total minus 7]).
0 Kudos
SeanKroencke
New Contributor
The problem is there isn't a static # of characters on the right that can remain in the result. The first 7 characters need to be removed in all instances, though.

Thanks for your help, I should have specified that originally.
0 Kudos
DarrenWiens2
MVP Honored Contributor
You get the total number of characters with Len(). Len() - 7 is the number of characters to keep. Right() will keep that number of characters from the righthand side. You're not hardcoding anything except 7, the number of characters to exclude.
0 Kudos