Microsoft KB Archive/114251

{| = How to Append One Field to End of Another in Same Table =
 * width="100%"|

ID: Q114251

The information in this article applies to:


 * Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, 2.6
 * Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, 2.5a, 2.5b, 2.6
 * Microsoft FoxPro for Macintosh, version 2.5b

SUMMARY
You can take the values of one field and append records to the same table, putting those values into another field. The program below demonstrates this process using two character fields. If the field types were different, some data conversion would be necessary.

MORE INFORMATION
The following code example first opens the CUSTOMER database, then SELECTs the CITY field into a cursor named QUERY, with a field name of ADDRESS. It then SELECTs the original table, CUSTOMER, and appends the new records into it. The last two statements move the record pointer to 501 and browse the CUSTOMER table. Records 501-1000 now contain records 1-500 from the CITY field.

SELECT City AS Address FROM Customer INTO CURSOR Query SELECT Customer APPEND FROM DBF('Query') GOTO 501 BROWSE