General information
Category:
Coding, syntax & commands
>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.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only