Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP9- date problem when append from CSV file
Message
De
04/06/2007 04:11:30
 
 
À
29/05/2007 10:39:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01229042
Message ID:
01230140
Vues:
14
This message has been marked as the solution to the initial question of the thread.
>Is anyone running into a problem with the date field when appending from a csv file? The csv file contains a field value as 01/15/2007 and when using append from ... type csv command, the value on the cursor become 01/15/0007. This same command works fine in vfp6 and if I changed the type to delimited it also works.
>
>Does someone know what's wrong here? or any suggestion will be appreciated.
>
>Thanks.


I can reproduce the problem only when the date in the file doesn't follow the expected date format (mm/dd/yy[yy]). Can't test in VFP6 at the moment, but here results from other versions.
SET SAFETY off
SET CENTURY on
CLEAR 
?STRTOFILE("f1"+CHR(13)+CHR(10)+"01/15/2007"+CHR(13)+CHR(10)+"1/15/2007", "testCSV.txt")
CREATE CURSOR foo (f1 date)
APPEND FROM testCSV.txt TYPE CSV
LIST
VFP9:
        25
Record#  F1        
      1  01/15/2007
      2  01/05/0007
VFP8:
        25
Record#  F1        
      1  01/15/2007
      2  01/05/0007
VFP7:
        25
Record#  F1        
      1  01/15/0020
      2  01/05/1900
It is possible that we'll make APPEND FROM command to be more robust in regard to the date format variations in the upcoming VFP9 SP2. In the mean time make sure that CSV file uses expected format for date values.

Thanks,
Aleksey.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform