Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Append from and Excel dates
Message
 
To
11/09/2002 10:15:02
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00699313
Message ID:
00699335
Views:
17
>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
Map
View

Click here to load this message in the networking platform