Database design question

  • Thread starter Thread starter Zuzu
  • Start date Start date
Z

Zuzu

Hi everybody! Some people might think that my question is stupid but I
would like to know what's the best approach. Let's say in a table you
have a 2 currency fields, Cost1 and Cost2. What is the best solution
for adding up Cost1 and Cost2:
1. would it be better to create a third field called TotalCost in the
table where Cost1+Cost2 is saved by a form and then the query that
runs the report pulls the total from the TotalCost field from the
table and it shows it in the report. Or
2. would it be better to add Cost1 and Cost2 in the query (don't
create the TotalCost field) and the result will be shown on the
report.

Thank you all!
 
Zuzu,
#2... As a general rule, don't "save" a calculated value that can always be derived
from data you already have. A common example would be Price * Qty = LineTotal... you
would not save LineTotal, but recalculate it "on the fly" in any subsequent form, query,
or report.
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 
Zuzu,
#2... As a general rule, don't "save" a calculated value that can always be derived
from data you already have. A common example would be Price * Qty = LineTotal... you
would not save LineTotal, but recalculate it "on the fly" in any subsequent form, query,
or report.
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVPhttp://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."







- Show quoted text -

Thank you for your help Al Campagna!
 
Back
Top