How do you add colums in a record?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

How do i get colums with in the same record to add? For example i have 4
colums ( Description | Item Cost | QTY | Total ) how do i get the "total"
colum to sum the total from the "item cost" multiplied by the "QTY" ?

Thanks
 
Jafranklin2 said:
Hello,

How do i get colums with in the same record to add? For example i have 4
colums ( Description | Item Cost | QTY | Total ) how do i get the "total"
colum to sum the total from the "item cost" multiplied by the "QTY" ?

Thanks

I think you will find the overwhelming advice is "don't do that" (don't
store calculated values in your table). I agree, although I can't
articulate all the reasons why. For starters, you don't need to: Simply
create a query on your SaleDetails table (or whatever it is) that
returns the calculated field such as [Item Cost] * QTY.

HTH
 
Hello,

How do i get colums with in the same record to add? For example i have 4
colums ( Description | Item Cost | QTY | Total ) how do i get the "total"
colum to sum the total from the "item cost" multiplied by the "QTY" ?

Thanks

You don't, not in a Table.

Access tables ARE NOT SPREADSHEETS. Don't attempt to store the total -
or any other caluclated field - in a table, at all!

Instead, store the first three columns in your Table, and use a Query
with a calculated field; you can do this by typing

Total: [Qty] * [Item Cost]

in a vacant Field cell in the Query. This Query can then be used as
the recordsource for a Form or Report.

John W. Vinson[MVP]
 
(don't
store calculated values in your table). I agree, although I can't
articulate all the reasons why.

Here's a few, from my boilerplate answer on the subject:

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top