Pricing Uplift

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table with fields SORCode (text) and Price (currency). I have added
two fields KCode and KPrice. I would like the field KCode to be the SORCode
appended with "KTF" and the field KPrice to be Price * 2.

How would I be able to programatically cycle all the records and update the
KCode and KPrice fields?

Is it possible to do this with a query?

Thanks

Dave
 
Alex's code will do that; however, you probably should not. That is
essentially storing calculated fields which is frowned upon for good database
design. If you know that KCode will always be SORCode with KTF appended, the
place to do that is where the user would see it, not in the table. As to the
price, If a user changes a price in the table, then your KPrice will be
incorrect. Again, when you need to use the KPrice, calculate it, but don't
store it in the table.
 
Back
Top