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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I copy a field to another table

Status
Not open for further replies.

jackie1948

Programmer
Jan 25, 2002
78
US
Example of the table that I am needing to copy a field from. Oh yes I am using VFP7 not that means a whole lot to me but it might help you understand where i am coming from.

create table1 (agen C(4);
unit C(3);
ssn C(9);
tax1 C(228;
tax2 C (228);
hist C(180))

My question how do I copy,move what ever to get the key fields (agen,unit,ssn) and the tax1 field to a table called tax1.dbf.
Thanks
jackie
 
The following should do it;

Copy field agen,unit,ssn,tax1 to tax1
or
select agen,unit,ssn,tax1 from table1 into dbf tax1
 
You can also "create" a new table using code like what you already posted without the fields you don't want and then use "append from table1". When appending from another dbf, VFP doesn't care about field order, size or type (at least numbers --> characters). I find this method to be a great way to re-structure data into new layouts.

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top