Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why doesn't this REPLACE work
Message
De
30/01/2007 00:06:40
Suhas Hegde
Dental Surgeon
Sirsi, Inde
 
 
À
29/01/2007 22:59:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01190365
Message ID:
01190368
Vues:
13
>
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform