Skip to Content
avatar image
Former Member

How to check for first position is alpha

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 ' '

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 05, 2017 at 07:54 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 04, 2017 at 07:40 PM

    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 ' '

    Add comment
    10|10000 characters needed characters exceeded