Re: Simply adding two fields
- From: Pat Backowski <PatBackowski@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 26 Nov 2007 08:44:12 -0800
John,
I was simply looking for some help in how to add 2 numbers together in a
query.
I was NOT looking for criticism on the age-old tried and true method of
Master-transaction updates.
Your response not only didn't answer my question, but you are wrong.
If I have to read 50,000 transactions every time some one wants to know how
what the balance of widgets is, there'd be a helluva lot of disk access going
on
Thanks for Nothinig
Pat.
"John W. Vinson" wrote:
On Thu, 22 Nov 2007 06:07:02 -0800, Pat Backowski.
<PatBackowski@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Hi,
I'm reading a transaction file of widgets delivered and I want to update the
quantity in the master record, so I do a query joining the master and
transaction data. That works fine. I've also created a new element in the
resulting table, lets call it answer. I want "answer" to be the sum of two
elements that are in the table, one from the master and one from the
transaction.
How do I do that?
Generally, you don't.
Storing derived data such as this in your table accomplishes
three things: it wastes disk space; it wastes time (almost
any calculation will be MUCH faster than a disk fetch); and
most importantly, it risks data corruption. If one of the
underlying fields is subsequently edited, you will have data
in your table WHICH IS WRONG, and no automatic way to detect
that fact.
Just redo the calculation whenever you need it, either as a
calculated field in a Query or just as you're now doing it -
in the control source of a Form or a Report textbox.
John W. Vinson [MVP]
- Follow-Ups:
- Re: Simply adding two fields
- From: John Spencer
- Re: Simply adding two fields
- References:
- Re: Simply adding two fields
- From: John W . Vinson
- Re: Simply adding two fields
- Prev by Date: Re: Expression Help
- Next by Date: Re: Nz function from .NET
- Previous by thread: Re: Simply adding two fields
- Next by thread: Re: Simply adding two fields
- Index(es):
Relevant Pages
|