>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.