Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set relationship and copy
Message
From
14/12/2006 16:04:42
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01177790
Message ID:
01177792
Views:
6
>Hi,
>I have two tables, table1 has the following structure
>Table1: dog, howtall, howfast, furtype
>Table2: cats, howtall, hasclaws, food
>
>I have set the relationship between the two, using the field howtall
>
>Now here is my problem, after having set the relationship, I want to copy
>the table to a new table
>
>copy to newtable a->dog, a->howtall, b->cats, b->howtall
>
>But I get an error. How can I copy selected fields from two tables?
>
>Thanks
>Steve

You have howtall twice.
copy to newtable a.dog, a.howtall, b.cats
BTW, why not use SQL syntax, where you can do everything in one line?
Select dog, table1.howtall, cats from table1 inner join table2 on table1.howtall=table2.howtall;
  into table newtable
Or
Select dog, table1.howtall, cats from table1, table2 where table1.howtall=table2.howtall;
  into table newtable
Previous
Reply
Map
View

Click here to load this message in the networking platform