ggh Posted August 6, 2008 Posted August 6, 2008 I need extract certain characters from a text field. As an example I want just the second letter "e" from a text field containing the word "text". I believe I should use the position and left functions. I can't quite figure out how these work.
Tim W Posted August 6, 2008 Posted August 6, 2008 I agree. However, the word "text" only has 1 "e", that not withstanding, I would suggest the following combination: Middle ( SuppliedTextField ; Position ( SuppliedTextField ; "e" ; 1 ; 2 ) ; 1 ) Were the field not to contain a second "e" or your desired criteria, whatever that might be, what do you want returned as a result? HTH Tim
comment Posted August 6, 2008 Posted August 6, 2008 the word "text" only has 1 "e", that not withstanding, I would suggest the following combination: Middle ( SuppliedTextField ; Position ( SuppliedTextField ; "e" ; 1 ; 2 ) ; 1 ) If the supplied text contains only one occurence of the "e" character, the calculation will return the first character of the supplied text. If the supplied text does contain a second occurence of the "e" character, then it's a safe bet the result is going to be "e" - why calculate at all? I am under the impression the question is actually "what is the second letter of text" - which is answered by: Middle ( text ; 2 ; 1 )
Tim W Posted August 6, 2008 Posted August 6, 2008 I am under the impression the question is actually "what is the second letter of text"That would make sense, wouldn't it? I misread the op, sorry. Tim
ggh Posted August 7, 2008 Author Posted August 7, 2008 The question was "what is the second character", and middle does it. I knew there had to be a simple way to extract what I needed. Thanks!
Recommended Posts
This topic is 6012 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now