Jump to content

This topic is 8584 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

I am using a calculation with a field mask to display a SSN properly formatted. I have found that SSN begining with zero do not format properly and a number is added in (ex.012346789 displays as 123-46-6789) What am I doing wrong here?

SSN field is formated as text

SSN Mask field is formated as a Calculation with calculation result being text (this is the only way I didn't get some funky formula while tabbing through the record), and the calculation is.

Left(Abs(SSN), 3) & "-" & Middle(Abs(SSN), 4, 2) & "-" & Right(Abs(SSN), 4)

Thanks in advance!!

Posted

I'm not sure why you used the abs() function, but I suggest making a text field version of the SSN with leading zeroes added like this:

cTextSSN = Right("000000000" & Substitute(NumToText(SSN),"-",""), 9)

Then your formatted SSN will be:

Left(cTextSSN, 3) & "-" & Middle(cTextSSN, 4, 2) & "-" & Right(cTextSSN, 4)

This topic is 8584 days old. Please don't post here. Open a new topic instead.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.