Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update single column from another table
Message
From
28/11/2001 14:53:21
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00587103
Message ID:
00587145
Views:
18
>Thanks Jay! The results are exactly as I wanted!
>
>>>Max --
>
>>>You need to add a SQL 89 join condition to the UPDATE to join the table and >>temporary query together, as follows:
>
>
>>>SELECT emp_name, commission, rptdate ;
>>> FROM Table1 INNER JOIN Table2 ;
>>> ON Table1.emp_name = Table2.emp_name;
>>> WHERE Table1.rptdate = Table2.rptdate;
>>> ORDER BY Table1.emp_name;
>>> into cursor crsTemp
>
>>>UPDATE Table2 SET Table2.commission = crsTemp.commission ;
>>> WHERE Table1.emp_name = Table2.emp_name;
>>> AND Table1.rptdate = Table2.rptdate
>
>
>>>Jay

Glad that worked! I've got a headache today, and have a bit of tunnel vision. As Robert mentioned, the UPDATE as shown above should work by itself without the intermediate query.

Jay
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform