hlabonte Posted August 21, 2007 Posted August 21, 2007 I need to look at the last character of a field and know whether it is alpha or numeric. Can anyone help me out on this?
Lee Smith Posted August 21, 2007 Posted August 21, 2007 This calculation will give you a 0 if it is Alpha, and 1 if it is numeric. GetAsBoolean ( Right ( YourField ; 1 ) ) Lee
hlabonte Posted August 21, 2007 Author Posted August 21, 2007 perfect, just what I needed! Thank you!
comment Posted August 21, 2007 Posted August 21, 2007 Well, not really - that is if you consider zero to be a numeric character. Try instead: IsEmpty ( Filter ( Right ( Yourfield ; 1 ) ; "0123456789" ) )
Lee Smith Posted August 21, 2007 Posted August 21, 2007 (edited) Hi comment, Good catch. I tested it on every thing except a zero in the last position. Can you possibly explain to me why FileMaker will filter it out as numeric, but not see it as numeric? Lee Edited August 21, 2007 by Guest
comment Posted August 21, 2007 Posted August 21, 2007 Filter() is a text function - you can put any characters into the filterText parameter, and Filemaker will use them without considering any other meaning they might have in another context. The fact that Filter ( text ; "0123456789" ) leaves only numeric characters is pure coincidence as far as the Filter() function is concerned. OTOH, GetAsBoolean() is a logical function. It evaluates the data parameter as being either TRUE or FALSE. Zero is evaluated as FALSE, same as empty.
Lee Smith Posted August 21, 2007 Posted August 21, 2007 Hi comment, Oh. Doh. Now I understand why. Thank you for your explanation, you have once again enlightened me, and it is appreciated. Lee
Recommended Posts
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