How to Append One Field to End of Another in Same Table

Last reviewed: June 27, 1995
Article 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

REFERENCES

"Commands & Functions," version 2.0 (MS-DOS), pages C3-701-711, C3-136, and C3-274

"Language Reference," version 2.5 (Windows and MS-DOS), pages L3-862-874, L3-193, L3-356


Additional reference words: FoxMac FoxDos FoxWin 2.00 2.50 2.50a 2.50b 2.60
add
adding
join
joining
KBCategory: kbprg kbcode
KBSubcategory: FxprgBrowse


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.