Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bad numeric value reading Excel file
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01512647
Message ID:
01513026
Vues:
80
Thanks everyone for the tips but none worked. The problem is that the data was hand entered and some wound up as text and some as decimal numbers. In the end the fix was too simple. I created an Excel macro that put a Tilda (~) in front of each part number. This caused all the part numbers to become char type. Then I stripped off the Tilda in my prg while reading it.

John


>>We update customer price lists from Excel spreadsheets. Over the years I have been able to read any of the values that might be in a cell but this one has me pulling my hair out.
>>
>>The part numbers are in a format of 999.999 Most of the time but sometimes 999.999ABC and sometimes 999.9999. The problem is that although the part number shows as 123.456 or 123.4567 in the cell, TRANSFORM() converts it to 123.45670000000. Any ideas on how to grab the number as it should be. I can't just trim the number as the length varies and sometimes does end in 00.
>
>Try using alltrim(padr(myNumber, 30)).
>
>Transform depends on SET DECIMALS setting.
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform