Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Matrix rate
Message
De
25/06/1999 15:54:22
Dovi Gilberd
Dovtware Consulting Inc
Miami, Floride, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00233938
Message ID:
00234162
Vues:
27
would ther ebe a posibility of me sending you the dbf for some help from you..i would really appreciate it..









>>the problem i have restructuring the rates table is that there are 800 areacodes
>>and 20 rates so i would have to imput in manually 16000 records...?
>
>Create a table and call it something like NewRates with the following structure:
>
>KeyID
>Code
>Country
>RateID
>RateAmount
>
>Run the following against the current Rates table:
>select Rates
>locate
>scan
>   for i = 3 to fcount()          && 3rd field is Rate1, etc,
>       lnRate = eval(field(i))    && returns the actual value in the field
>       insert into NewRates ( Code, Country, RateID, RateAmount) ;
>          values ( Rates.Code, Rates.Country, i - 2, lnRate )
>   endfor
>endscan
>select NewRates
>replace all KeyID with RecNo()   && populate all the KeyID fields
>When you add a new record, KeyID needs to be the next number from you Primary Key generator function. Once you verifyt the data in the NewRates table against the prior Rates table, you can delete the Rates table and rename the NewRates table to Rates.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform