Information générale
Catégorie:
Codage, syntaxe et commandes
>Hello group,
>
>When I use the code
>
>LOCAL lcExcelPath
>
>
>lcExcelPath = getfile("xls")
>
>
>APPEND FROM &lcExcelPath type XL8
>
>I get everything but the dates I am unsing Excel in Office 2000
>the date format in excel is 3/14/1998
>
>How do I get the dates to transfer?
>
>Thanks
>Jim
Most likely you have a custom format for dates in Excel. In this case Excel stores date values in the 1900 Excel NUMERIC format (which is differ from VFP dates representation), but displays dates custom formatted. So if you append in VFP to the table having fields D it will not recognize numbers as dates (however you could append to the "C" or "N" fields and get numbers instead of dates).
You have a couple ways to resolve it:
1. Create cursor with field "C" or "N", append from Excel and recalculate dates based on 1900 Excel format (see Excel Help for NOW() function for more details).
2. You may use Excel Automation and change date format in Excel to standard format (which is m/dd/yy, I believe). Then you should have no problem when appending.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement