Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COPYing numeric data to an XLS
Message
De
22/07/2009 18:08:40
 
 
À
22/07/2009 18:04:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Divers
Thread ID:
01413826
Message ID:
01413841
Vues:
58
>>>>Hi All:
>>>>
>>>>I have a table with a character field. I COPY it to an XLS. In the case that the data in the field is numeric, I want the data to be numeric in the XLS file. Right now it comews across as text since it came from a character field. The field must be character, since it sometimes contains data that is not numeric.
>>>>
>>>>Any ideas?
>>>>
>>>>Thanks,
>>>>
>>>>Yossi
>>>
>>>I'm not sure you can have different formats in the same column. It may be either numeric or character, AFAIK.
>
>Actually, that is not a problem, since for a given COPY, they will all be numeric, so I envisage something like:
>
>
>COPY fields Numericify(CharField1) TO ("c:\junk\junk") xls
>
>
>CharField1is a character field

Why don't you just select out the data you want and in the select statement convert it to numbers.
SELECT VAL(charfield1) AS numfield1 WHERE ISDIGIT(charfield1) INTO CURSOR ac_numbers
COPY FIELDS numfield1 TO c:\junk\junk.xls TYPE XLS
USE IN ac_numbers
I assume you already know what the where statement should be to filter down the results
Charles

"The code knows no master." - Chuck Mautz
"Everybody is ignorant, only on different subjects." - Will Rogers
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform