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 fieldsWhen 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.