You can format numeric fields to have leading zeros with a format of @RL and the input mask of 999-99-9999. However, if you're using this column as a key or something to search by, you will get incorrect results as the leading zeros will not be preserved. Much better to store it as C(9) or V(9).
Laurie On 12 April 2014 22:57, Jeff Johnson <[email protected]> wrote: > A zero in the first digit is truncated. > > > > On 4/12/2014 1:08 PM, [email protected] wrote: > >> Hope this helps: >> I am using VFP9 SP2 >> >> I have a text box on a form I named txtcSSN >> It has a control source: vnmpt.cssn which is a view for a table with the >> field named cSSB C(9) >> The input mask is 999-99-9999 (same as yours) >> The width is 90 >> >> Mine works the way you want. Not sure why yours does not. >> >> >> On 4/12/2014 8:56 AM, Vincent Teachout wrote: >> >>> Jeff Johnson wrote: >>> >>>> Greetings: I have a text box who's control source is a social >>>> security number stored as a number. Obviously I have done this for years. >>>> Yesterday it was brought to my attention that the leading zero messed up >>>> the formatting: >>>> >>>> 012566666 produces 125-66-666 instead of 012-56-6666. I am using an >>>> input mask of 999-99-9999. >>>> >>>> What do I need to do to fix this. >>>> >>> >>> If you're not going to do math with it, it shouldn't be stored as a >>> number. Change the field to a char(9), convert the numbers to char strings >>> (tranform(), str(), whatever you want), input with format of @R and input >>> mask of 999-99-9999. >>> >>> If you're really, really sure that the mangled numbers are always >>> missing one or more zeros, then once you're changed the field to char, you >>> can replace all ssn with padl(alltrim(ssn)),9,'0') >>> >>> [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/camvtr9d3u_fddpskx98bbqqvyuwktjtayg0fwc5o_mi2dyx...@mail.gmail.com ** 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.

