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

Looking for a command... 1

Status
Not open for further replies.

kate

Programmer
Nov 19, 2001
51
US
I'm working in VFP 6.0. I'm trying to combine two foxpro tables into one. They both have a field that is same called sft_cd. I want to add the extra fields from one table to the other table, but I don't want to have to type in the info again. For example

table a:
sft_cd (N,2)
start_time (C,4)
end_time (C,4)

table b:
sft_cd (N,2)
split (L)
first (N,2)
second (N,2)

I want to combine these tables into table c

table c:
sft_cd (N,2)
start_time (C,4)
end_time (C,4)
split (L)
first (N,2)
second (N,2)

Is there a foxpro command that would do this, or will I have to write a short program. Writing the program is not a big deal, I'm just trying to cut some corners.

Thanks in advance. Please let me know if there are any questions.
 
You need to use an SQL statement. I've not tested this but it'll be a start:
Code:
Select a.sft_cd, a.start_time, a.end_time, b.split, b.first, b.second from a, b where a.sft_cd = b.sft_cd into table c

Geoff Franklin
 
Hi Kate,

Create a view that joins the tables. Use the view and COPY TO tableC.

Regards,

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top