Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Growth percents
Message
 
À
11/03/2006 17:24:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Crystal Reports
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01103467
Message ID:
01103513
Vues:
17
>OK
>Please run the following code and look what you got:
>
create cursor mycursor (year i,saled i)
>insert into mycursor values (1999,1842)
>insert into mycursor values (2000,1914)
>insert into mycursor values (2001,1781)
>insert into mycursor values (2002,1987)
>insert into mycursor values (2003,2151)
>insert into mycursor values (2004,2551)
>insert into mycursor values (2005,2321)
>alter table mycursor add column growth i
>SELECT MyCursor
>m.lnOldYear = Saled
>SCAN
>    REPLACE growth WITH Saled/m.lnOldYear * 100
>    m.lnOldYear = Saled
>ENDSCAN
create cursor mycursor (year i,saled i, growth I)
insert into mycursor values (1999,1842,0)
insert into mycursor values (2000,1914,0)
insert into mycursor values (2001,1781,0)
insert into mycursor values (2002,1987,0)
insert into mycursor values (2003,2151,0)
insert into mycursor values (2004,2551,0)
insert into mycursor values (2005,2321,0)
SELECT MyCursor
GO TOP    && Important
m.lnOldYear = Saled
SCAN
    REPLACE growth WITH ((Saled- m.lnOldYear)/m.lnOldYear * 100)
    m.lnOldYear = Saled
ENDSCAN
BROWSE NORMAL
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform