XL5: FoxPro Dates Exported to Microsoft Excel as Text

ID: Q123197


The information in this article applies to:


SYMPTOMS

When you export a FoxPro database containing a DATE field to Microsoft Excel by using the Copy To dialog box, the dates are formatted as text when you open the file in Microsoft Excel.


CAUSE

This behavior is by design of Microsoft FoxPro. When you use the Copy To feature in Microsoft FoxPro to copy your data to a Microsoft Excel file, the data in the .DBF file is exported as unformatted text strings.

WORKAROUNDS

To correct this problem, do the following in Microsoft Excel 5.0:

NOTE: These steps assume that cell A2 contains the date and that cells B2 and C2 are empty.

  1. In cell B2, type "=DATEVALUE(A2)" (without the quotation marks), and then press ENTER.


  2. Select cell B2 again. From the Edit menu, choose Copy.


  3. Select cell C2. From the Edit menu, choose Paste Special.


  4. In the Paste Special dialog box, under Paste, select the Values option, and then choose OK.


You can now use the Format Cells dialog box to format the date value with the desired date format.

To avoid this behavior, export the Microsoft FoxPro data using the Table (DBF) file format instead of the Microsoft Excel format.

For additional information, please see the following article(s) in the Microsoft Knowledge Base:
Q101288 PRB: FoxPro Dates Exported to Microsoft Excel as Characters


REFERENCES

For more information about Tips For Importing, Exporting, And Sharing Data, choose the Search button in Help and type:

importing data from other applications, tips on

Additional query words: 2.50 2.50a 2.50b 2.x 2.50x 4.00a 5.00c Export date spread sheet tshoot


Keywords          : 
Version           : 4.00 4.00a 5.00 5.00c
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: July 29, 1999