Find first Alpha Character

scotthutchings

Registered User.
Local time
Yesterday, 16:09
Joined
Mar 26, 2010
Messages
96
I have a variable length project number from which I need to extract just the numeric portion. How do I determine the location of the first alpha character?

Location = InStr(MyField,???)
 
Well if your project number is always just numeric up until an alpha character you could use the val function (i.e. 1234abcd) (val would return 1234 in this case). If you have alternating numeric/text values such as (1a2a3a4a) you would need a custom function to extract all the numbers, val will return 1 and stop at the first string it finds.

Location = Val(MyField)
 
Perfect! This is just the function I was looking for!

Thanks for your help!
 

Users who are viewing this thread

Back
Top Bottom