Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Importing Excel Files - Date Problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00548892
Message ID:
00548920
Vues:
23
I forgot to mention that it's old foxpro dos working code. You'll have to clean it up for VFP yourself :)

>Excellent!!! Thanks for the quick answer.
>
>>Excel keeps dates internaly as serialized number. You can convert it to date by using following function
>>
>>*  Purpose  Convert Serialized-Number-to-Date into Date
>>*  Param's  Serialized Number
>>*  Return  Correspondet date in the date format
>>*
>>*     Note  1. We are using Foxpro ability to do arithmetic with dates
>>*           2. We are assuming that the serialized number 1
>>*		corresponds to the date 12/31/1899
>>
>>PARAMETER pvSerNum, pdBaseDate
>>
>>PRIVATE dBaseDate, nSerNum
>>nSerNum = IIF(TYPE("pvSerNum")="C", VAL(pvSerNum), pvSerNum)
>>dBaseDate = IIF(EMPTY(pdBaseDate), {12/31/1899}, pdBaseDate)
>>RETURN dBaseDate + nSerNum - 1
You can also save excel spreedsheet as CSV file and than import into VFP.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform