![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Using Visual Foxpro 3, I have a field within my database and the value of the field is determined by a calculation of data from other fields in the same database. Where is the best place to perform this calculation and where is the best place to insert the code that will perform the value assignment. Kind Regards, Boulent |
#3
| |||
| |||
|
|
First, that's usually not good database design - if you can calculate the data from other data in the same row (record), then you shouldn't store it, since it'll need to be updated anytime the dependent fields are changed. Just compute it when you need it. If you must calculate it, then you could use the database to use field validations to update the dependent field. Or if it isn't system w4ide, you could put it in a form user method. Rick |
#4
| |||
| |||
|
|
"Rick Bean" <rgbean (AT) NOSPAMmelange-inc (DOT) com> wrote First, that's usually not good database design - if you can calculate the data from other data in the same row (record), then you shouldn't store it, since it'll need to be updated anytime the dependent fields are changed. Just compute it when you need it. If you must calculate it, then you could use the database to use field validations to update the dependent field. Or if it isn't system w4ide, you could put it in a form user method. Rick Unfortunately that is the problem. Its been ten years since I last used Foxpro and it is the only database development tool I am even slightly familiar with. Hence the problem I am having is knowing where and how to perform the calculations outside the database structure. |
![]() |
| Thread Tools | |
| Display Modes | |
| |