Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trouble importing field from Excel
Message
De
09/09/2003 15:50:11
Jill Derickson
Software Specialties
Saipan, CNMI
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00827019
Message ID:
00827632
Vues:
15
Hi Doug,

I just went through a conversion process w/a client who was exporting from Access into Excel. My code read in the data (w/IMPORT command) to temporary tables, massaged it a bit and loaded it into VFP tables.

There was something the client was doing to (sometimes) make date columns look like numbers to VFP, and some numbers looked like date columns.

I ended up coding around it...using formulas based on:
ldBase = DATE( 1899, 12, 30 ) && CTOD("12/30/1899")
liToday = DATE()-ldBase && number of days since 12/30/1899 to TODAY

For values that should be numbers, i used:
CTOD( BADFIELD ) - ldBase

For values that should be dates:
DATE()-(liToday-INT(VAL(BADFIELD)))

HTH, j

>Do you have any idea how to force VFP to import as a number -- to override the date formatting in Excel??
>
>Thanks,
>Doug
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform