Microsoft KB Archive/163957

= FIX: APPEND FROM TYPE SDF Brings in Older Dates Incorrectly =

Article ID: 163957

Article Last Modified on 2/16/2005

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a

-



This article was previously published under Q163957



SYMPTOMS
When appending from a text file using the TYPE SDF clause of the APPEND FROM command, older dates do not append into the table properly. (This assumes that the field in the table is defined as a date field. If the field is defined as a character field, then the dates in the text file append properly.)

As the date in the text file is appended to the date field, the following occurs:
 * The month of the date in the text file is placed into the year section of the date field.
 * The second digit in the day of the date in the text file is placed into the month section of the date field with a zero replacing the first digit.
 * The year of the date in the text file is placed into the day section of the date field.



RESOLUTION
When creating the structure of the table, define the field that holds the date as a character field. This character field can be changed to a date field after the text file has been appended into the table.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in Visual FoxPro 6.0.



Steps to Reproduce Behavior
 Create a table with two fields: a character field with a width of 8, and a date field. Create a text file called Test.txt with the following data:

RecordA 02/14/05

RecordB 11/25/15

RecordC 04/02/25

RecordD 01/20/35

RecordE 12/16/45  Issue the command:

APPEND FROM test.txt TYPE SDF  Browse the table and note that some of the older dates are rearranged as was mentioned in the SYMPTOMS section of this article.

Keywords: kbbug kbfix kblist KB163957

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.