Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why doesn't this REPLACE work
Message
From
30/01/2007 00:06:40
Suhas Hegde
Dental Surgeon
Sirsi, India
 
 
To
29/01/2007 22:59:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01190365
Message ID:
01190368
Views:
14
>
>select customer
>scan
>    select sales
>    sum ordertotal for sales.customerid = customer.customerid to
>         nTotalSale
>    replace customer.totalsales with nTotalSale
>endscan
>
>
>The REPLACE statement does not work becuase sales.dbf is EOF(), but why?
>
>
>Just curious....
>
>TIA

How about
*Pseudo code
select customer.customerid as customerid,sum(sales.ordertotal) as ordertotal ;
from ;
customer,sales ;
where ;
sales.customerid = customer.customerid ;
into cursor temp group by 1

select temp
index on customerid tag cusid
select customer
replace customer.totalsales with temp.ordertotal ;
for seek(customer.customerid,'temp','cusid')
suhashegde
Previous
Reply
Map
View

Click here to load this message in the networking platform