Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting Character to Numeric
Message
De
21/11/2021 11:44:14
 
 
À
21/11/2021 11:31:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01682754
Message ID:
01682757
Vues:
37
Thank Tore. Appreciate it as all others. Gonna have to rethink that conversion, for those fields that have data that looks like: 0.04%. It gets converted to 4.00

>>Howdy and grand rising all,
>>
>>I have several fields adopted as character but need to be numeric. Data that currently exists in the fields are represented as characters and for example: -1.72% or 33.23%.
>>All of them have the percent sign in them hence why prior folks made it character. I need to convert to numeric in order to perform sorting from asc to desc as well as calculations. I'm running the following code but it's tell me too few arguments. I am also concerned the impact this would have if i placed within a Scan that is used to draw that data from a source table and insert into a new table with the fields being set as numeric.
>>
>>* ?VAL(STRTRAN(SourceData.SalesPergain),"%",,"")
>
>
?VAL(STRTRAN(SourceData.SalesPergain,"%",""))
Thanks in Advance.

J. Turner
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform