View Full Version : Calculations in tables...


deejay_totoro
09-14-2003, 05:30 AM
Hello,

I wonder if you can help me?

I am trying to do a simple time calculation, where I can calulate the duration of a call.

I can do this in the form (using =[EndTime]-[StartTime]) and the correct duration is displayed.

However, this information is not passed to the underlying table.

So my question is: how can I store this duration in the underlying table field (duration)?

I read in another post that it is not good to do calculations in tables in access (is this correct?) so I made a query - which dies calculate the duration properly.

However, the problem still remains - how do I pass this duration information, from either the form field - or the query - back to the corresponding field in the original table?

Thank you very much!

dj_totoro

RV
09-14-2003, 05:41 AM
As you found in another post, don't store calculated data in your table.
Use your query to calculate them and show the results of your calculation.

RV

deejay_totoro
09-14-2003, 05:44 AM
Thanks for your reply!

How can pass the calculation back to the table (and form?)

dj_t

pcEars
09-14-2003, 06:45 AM
DON'T store calculated data in your table.

To display it in your form, you can base the form on your query, or use an unbound textbox with the same expression as it's control source.

Mile-O
09-15-2003, 03:30 AM
Storing calculated information is a waste of your database's resources and is a violation of third normal form.

Calculated values, such as yours, are easily obtainable at runtime.

Try, if you can, to perform as many calculations as possible on your form and reports.

Although calculations in queries are possible they should be seen as a last resort as calculations can slow down queries (sometimes) almost to a standstill.