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')


_______________________________________________
Post Messages to: ProFox@leafe.com
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/53496228.2060...@taconic.net
** 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