Skip to Content
0

How to check for first position is alpha

Apr 04, 2017 at 07:30 PM

27

avatar image
Former Member

We have a data column, that if the first 2 are alpha and the last is alpha, and the 3-7 are numerical, that is what we want. If this is not the case,then we want to display a blanks.

For now if i can get just the first letter as alpha (from what i have seen either its' good or its not) for testing just the first is ok. but this is not compiling.

left({vwGenPatInfo.Prim_Policy_Certificate_No},1) in ["A" to "Z"] then ({vwGenPatInfo.Prim_Policy_Certificate_No})
else ' '

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Abhilash Kumar
Apr 05, 2017 at 07:54 AM
0

Hi Paul,

Please try this code:

stringvar s := {vwGenPatInfo.Prim_Policy_Certificate_No};
If s[1 to 2] IN ['A' to 'Z'] AND s[len(s)] IN ['A' to 'Z'] AND isnumeric(s[3 to 7]) then {vwGenPatInfo.Prim_Policy_Certificate_No}

-Abhilash

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Apr 04, 2017 at 07:40 PM
0

OK this is how to do for the first. For second I would do 1,2; and for last I guess another.

if left({vwGenPatInfo.Prim_Policy_Certificate_No},1) in ['A' to 'Z'] then ({vwGenPatInfo.Prim_Policy_Certificate_No}) else ' '

Share
10 |10000 characters needed characters left characters exceeded