Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Leading 0's problem in data
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01620054
Message ID:
01620055
Views:
68
>Hi Gang!
>
>Question....
>
>We have need to start using a field in a table that is, at the moment, Numeric (11,0), but in the future, to be Character C(11). The reason is government, of course... wanting to have Alpha data at the end of the numeric part.
>
>When the page would come up for the field on the form, in the past, the user could type in numeric data and be happy.
>
>Then, it came to pass that some entities wanted to have this padded on the left with '0's. Like 123 became 00000000123 when sent to the processor (as a string, not as a numeric at this point. It was still stored as numeric on the Server with NO leading 0's.
>
>This was handled by setting the FORMAT of the textbox for this field to be 'L' ( place leading 0's) and a Inputmask of 99999999999... but only for a numeric field.
>
>------
>
>NOW... they want to be able to have alpha data on the end of the field.... so we must change it to be C(11).
>
>Problem is -> How do you have the textbox to show leading '0's on the textbox, and be Editable at all times, yet be stored in the field WITHOUT the leading '0s'.
>( 123AB become 000000123AB in the textbox but in the stored field it will be ' 123AB' )
>
>
>Thanks!
>Tommy

In VFP9 check Help on LTRIM function.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform