Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Testing a Character field for Numeric Data'
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01415119
Message ID:
01415180
Views:
49
>>I am working with fields in a table, so for my purposes if there is even one '/' in the field, it's not numeric, so I fixed this by saying:
>>
>>
>>do case
>>case AT('/',x) > 0
>>    *Do date processing
>>case type(x) = 'N'
>>    *Do Numeric processing
>>otherwise
>>    *Do String processing
>>Endcase
>>
>
>What about 9-9-2009 ?

May be
case type(x) = 'N' and empty(chrtran(x,'1234567890.',''))
   * Do numeric process
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