Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strip leading zeros
Message
From
20/10/2009 18:54:16
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01430254
Message ID:
01430261
Views:
75
I know, that's why I put the "Please Note" comment.

>Check if LTRIM has extra parameters in VFP8 - it doesn't, unfortunately. Would be a piece of cake in VFP9.
>
>>Please Note: VFP 8
>>
>>I have a table with a PONUM field. It is a 10 character string. When the field is populated it is with PADL(value,10,"0"). While value is usually a number, it occasionally has a character in it so we could see (for example), 00001234-1
>>
>>I need an expression that essentially strips away the leading zeros and allows a comparison to another value. So if the user enters "2" we would filter by/select all records where the first non-zero character would be "2", getting (with EXACT OFF)......
>>
>>"0002567890"
>>"0000027890"
>>"00002678-1"
>>"0000000002"
>>etc.
>>
>>If not for the potential non-numeric characters I think I could use
TRANSFORM(VAL(value)) = "2"
but as the user enters more characters to refine the filter, I need to be able to account for those non-numerics.
>>
>>All suggestions muchly appreciated
>>
>>...........Rich
Previous
Reply
Map
View

Click here to load this message in the networking platform