This is of some interest to me, because my SSN has two leading zeroes and two 
trailing zeroes!

If the SSN is stored as a numeric (should NEVER do that, but history is what it 
is), you need BOTH 
the L and R codes:
   transform(NumericSSN, '@LR 999-99-9999')

If it's stored as a string, then the simple @R will work.

Dan Covill

Note:  I composed this using the Plain Text option in outlook.com.  Here's 
hoping!

----------------------------------------
> Date: Wed, 12 Nov 2014 12:57:41 -0600
> From: [email protected]
> To: [email protected]
> Subject: Re: Formtting Social Security Number with TRANSFORM()
>
> The only way it fails for me is if the first character is a 0.
> Otherwise, it seems fine with or without the @R.
>
> TRANSFORM(990059688, '999-99-9999') produces 990-05-9688
>
> Mike Copeland
>
>
> [email protected] wrote:
>> This works: WAIT WINDOW TRANSFORM('120406780','@R 999-99-9999')
>>
>> On 2014-11-12 13:39, Jeff Johnson wrote:
>>> I know it is possible to format a social security number with
>>> TRANSFORM() like this:
>>> = TRANSFORM(994959688, '999-99-9999')
>>> but it does not work if the number has one or two zeros.
>>>
>>> In a text box I can use a format KRLZ and it works in a textbox with
>>> an input mask, but can this be done with TRANSFORM() or do I need to
>>> write a UDF?
>>>
>>> TIA
>>>
>>> --
>>> Jeff
>
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to