Koonce Posted August 10 Posted August 10 (edited) I am trying to setup a calculation to select a number or letter from a field. Like Social Security number. I have that field and put in the social security. But for a form i want each number to go in a field so i can use on a form. If i use left(ssnumber, 1) i am good it is the rest that is tricky. is there any help out there and thanks in advance, I tried the middle function but that i did that wrong. Edited August 10 by Koonce
comment Posted August 11 Posted August 11 (edited) 52 minutes ago, Koonce said: I tried the middle function but that i did that wrong. The Middle() function is the right approach here: Middle ( SSN ; 4 ; 1 ) will return the 4th character in the SSN field. 52 minutes ago, Koonce said: i want each number to go in a field Instead of defining a separate field for each character you can use a single repeating calculation field = Middle ( Extend ( SSN ) ; Get ( CalculationRepetitionNumber ) ; 1 ) Edited August 11 by comment
Koonce Posted August 11 Author Posted August 11 that worked perfectly and if there is no number it will give a 1 just asking the reason i used a field is the form i was putting it on had different spacing
comment Posted August 11 Posted August 11 2 minutes ago, Koonce said: if there is no number it will give a 1 just asking Sorry, I am not sure what you're saying here. If there is no character at the specified position the result will be an empty string.
Koonce Posted August 11 Author Posted August 11 in the calc Middle( SSnumber ; 1 ; 1) i assumed the first number was the position the second number was returning a 1 if there was nothing in the position spot.
comment Posted August 11 Posted August 11 (edited) No, the last parameter is the number of characters to return: https://help.claris.com/en/pro-help/content/middle.html Edited August 11 by comment
comment Posted August 11 Posted August 11 No problem. BTW, any discussion concerning storing SSNs should mention this warning: https://www.ssa.gov/phila/ProtectingSSNs.htm
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