September 1, 200520 yr Hi Guys, I'd like to do a find on a field (defined as text) and depending on whether the 1st character is alpa or numeric, act accordingly. I'm ok on the logic and scripting side, I think I can extract the first character using the *Left ( text , number )* function - but how do I determine if it's alpha or numeric? I can't seem to find the correct function. Help appreciated.
September 1, 200520 yr If (Left ( text , 1 ) >= "0" and Left ( text , 1 ) <= "9") If true then Number else Alpha
September 1, 200520 yr if(texttonum(left(text,1))>=0,"Numeric","alpha") Edited September 1, 200520 yr by Guest
September 1, 200520 yr That won't work, I am afraid. If text does not contain numeric characters, then [color:blue]TextToNum(text) = 0 is true. So your If() will always return true. Try instead: Case( IsEmpty( TextToNum( Left(text , 1 ) ) ) , "alpha" , "numeric" ) or: Case( Length( TextToNum( Left(text , 1 ) ) ) , "numeric" , "alpha" ) Edited September 1, 200520 yr by Guest
September 1, 200520 yr You can try this too: Case( GetAsNumber ( Left ( text; 1 ) ) = "";"alfha"; "numeric" ) Oops: I realised only now that You have FM6... the function GetAsNumber() is for 7 owners !! Edited September 1, 200520 yr by Guest wrong version
Create an account or sign in to comment