Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
APPEND FROM not Y2K ok.... know a fix?
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00241414
Message ID:
00241476
Views:
17
>I found this out from a client today. If you use append from on an SDF file with a date in it... even if all 4 digits of the year are in the file FoxPro imports it to a date field using the first two characters of the year (century) as the year, and ALL dates have a 19 as century.
>
>Is there a way to make this work? I know there are other methods I can use, but I want to know if it is possible to make APPEND FROM work?
>
>Thanks,

Hi BOb,

If I recall correctly Fox has had trouble with importing dates from SDF files dating back to FoxBASE+. While I must admit I'm a little disappointed by this news, there's a simple work around.

Do the following, on the orginal table (with the actual date field), issue a call to AFIELDS(). Locate the field in question and change it from date to character. If the incoming dates are have the year in a 4 digit format with separators make the field 10 characters wide, otherwise if it's 2 digits 8. Create a cursor from the array and append the SDF file into it. Use the DBF() function to determine the actual name and location of the cursor. Then select the real table, and do an APPEND FROM (lcfile) where lcfile is the name of the cursor file. The dates in the table will be correct and the ROLLOVER clause (in the case of 2 digit years) will be respected.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform