Skip to main content
August 1, 2006
Answered

Losing first two 00's on my Maine SSN

  • August 1, 2006
  • 2 replies
  • 481 views
The state of main has preceeding 0's on their Social Security numbers, i.e. 005-44-8473

When I assign the 1st part of the SSN to a session variable, it drops the 00 and I only get 5.

This is blowing up my database and additional apps that rely upon the SSN.

How can I format that session variable to retain all three characters when the first one or two are 0's?

Any help is appreciated.
    This topic has been closed for replies.
    Correct answer
    I tried it with both "" around it and without that. I don't know why three input boxes were used, I inherited this issue.
    I have finally gotten it to work by doing this

    <CFSET #SESSION.ApplicantSSN1# = #NumberFormat(ApplicantSSN1, "000")#>

    2 replies

    Inspiring
    August 1, 2006
    How are you saving the session variables, are you using quotes around the number?
    You should use something like:
    <cfset session.ssn1 = '#ssn1#'>
    and make sure you have quotes around it. . .

    -Mike
    Correct answer
    August 1, 2006
    I tried it with both "" around it and without that. I don't know why three input boxes were used, I inherited this issue.
    I have finally gotten it to work by doing this

    <CFSET #SESSION.ApplicantSSN1# = #NumberFormat(ApplicantSSN1, "000")#>
    Inspiring
    August 1, 2006
    How are you assigning the 1st part of the SSN to a session variable. It
    sounds like you are doing it in such away that it is being treated as an
    integer or float. This would cause the drop of the preceding zeros.

    The best solution for this would be to do something the treats the value
    as a string.

    Out of curiosity why are you breaking up the value. One usually sees
    SSN numbers treated as a single value in a single variable.

    Scooby Doobie Doo wrote:
    > The state of main has preceeding 0's on their Social Security numbers, i.e.
    > 005-44-8473
    >
    > When I assign the 1st part of the SSN to a session variable, it drops the 00
    > and I only get 5.
    >
    > This is blowing up my database and additional apps that rely upon the SSN.
    >
    > How can I format that session variable to retain all three characters when the
    > first one or two are 0's?
    >
    > Any help is appreciated.
    >