The general "rule" (use that term loosely) is that anything you can
calculate from existing (stored) values doesn't need to be stored itself.
That said, there may be occasions when you decide to store, say, the
[SalesAmount] because the price-per-unit can be different from one time to
another. My suggestion about using a table to keep "charges-at-timerange"
would be a way to NOT have to store [SalesAmount], because that value could
always be calculated from:
* Qty
* Unit price-at-point-in-time (between Date1 and Date2 of the daterange
during which the price was in effect).
That method lets you keep a price history, and calculate what someone had
been charged back in '03...<g>
Good luck!
Regards
Jeff Boyce
Microsoft Office/Access MVP
Eric said:
I think I may have worded the question badly, the fee itself cannot change
unless NYS says it can change, however I think I want the actual charge,
i.e.
we sent 100 pages at .75 = $75.00 to be stored in the table. If I do as
suggested, the charge amount will not be stored in the record. Do you
have
a suggestion with that or maybe I do not need to have the charge amount
saved
as we always know it is going to be #pages x .75?
Thanks,
Eric
Jeff Boyce said:
Eric
Actually, I suspect you need another table that holds
"fee-for-timeperiod"
data. After all, when you change your fee, you'll want to use the new
amount, but be able to see how much used to be charged, right?
Regards
Jeff Boyce
Microsoft Office/Access MVP
Thank you. I did as you suggested and it worked! Thanks! However, I
would
like the fee amount to be stored in the table as well. Is there a way
to
go
about that. If it only calculates on the form or a report then it will
not
be part of the record correct?
Thanks,
Eric
:
It would not be correct to store the calculation. Doing so violates a
basic
database normalization rule. The correct method is to perform the
calculation whenever you need to present the information to a user
either
on
a form or report. The how to is to use a unbound text box and do the
calculation in its Control Source property:
=[txtPageCount] * 0.75
Where txtPageCount is the control on your form (forms don't have
fields,
they have controls. Fields are properties of tables and queries).
--
Dave Hargis, Microsoft Access MVP
:
I would like to have a field be mulitplied by a set number and that
number be
stored in another field, for example:
We copy medical records and charge a .75 cents per page. What I
would
like
to do is that when the number of copies is entered into field it
will
be
times by the .75 cents and display the result/fee for the copies in
another
field.
Thanks,
Eric