Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Appending Records From One Table To Another

Status
Not open for further replies.

Creeder

Programmer
Jul 5, 2000
110
MY
Hi All,

I have the following scenerio:

Customer A has Accounts: A11,A22,A33
Customer B has Accounts: B11,B22,B33
Customer C has Accounts: C11,C22,C33

I then retrieve all of the accounts for the Customer A into a temp cursor I would get something like

TempCursor1:
Customer Accounts
-------- --------
A A11
A A12
A A13

Now I would do a SCAN..ENDSCAN loop and do and insert each of the information into TempCursor2

I would then repeat the same steps for customer B and C therefore the end result would be

TempCursor2:
Customer Accounts
-------- ---------
A A11
A A12
A A13
B B11
B B22
B B23
C C11
.. ..

It's kind of tideous using The SCAN..ENDSCAN loop. THerefore is there a comand in Fox that let you append from table to another table? Of course the table will have the same structure. Any help is much appreciated.

Thanks

Yue Jeen
 
Creeder,

Or is it that you could use SQL for this? Try...

Code:
SELECT Customer,Accounts FROM *** INTO CURSOR TempCursor2 orde by customer,accounts

Stewart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top