Im going to use this calculated value as part of a report. the report
will
show total production levels for each machine. The form has the machine
number entered, stored to table, hourly production levels, 06-07, 07-08
etc,
stored to table. The way i was thinking about doing the report was by
linking it to the table, how do i get the calculated value included in
this?
:
There's no need to store the total.
As fellow MVP John Vinson likes to say "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."
SImply add a computed field in a query that figures out the date, and
use
the query wherever you would otherwise have used the table.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Thanks got that working now. I'm trying to store the value from the
calculation in a table. The table is called Data - Production Levels,
field
name is Total. How do I do this?
:
Is the result supposed to be a long integer? If so, try:
=CLng([06-07])+CLng([07-08])+CLng([08-09])+CLng([09-10])+CLng([10-11])+CLng([11-12])+CLng([12-13])+CLng([13-14])+CLng([14-15])+CLng([15-16])+CLng([16-17])+CLng([17-18])
If it's supposed to be some other type (Single, Double, etc), replace
CLng
with the appropriate function (CSng, CDbl, etc.)
Actually, if there's a chance that one or more of the text boxes
might be
empty, you should probably use
=CLng(Nz([06-07], 0))+CLng(Nz([07-08], 0))+CLng(Nz([08-09],
0))+CLng(Nz([09-10], 0))+CLng(Nz([10-11], 0))+CLng(Nz([11-12],
0))+CLng(Nz([12-13], 0))+CLng(Nz([13-14], 0))+CLng(Nz([14-15],
0))+CLng(Nz([15-16], 0))+CLng(Nz([16-17], 0))+CLng(Nz([17-18], 0))
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
text fields
:
Are these 12 fields text fields or number fields?
--
The 11th day of every month:
http://truthaction.org/forum/index.php
:
I'm trying to add the numbers from 12 fields in a form. The
formula
im
using
is:
=[06-07]+[07-08]+[08-09]+[09-10]+[10-11]+[11-12]+[12-13]+[13-14]+[14-15]+[15-16]+[16-17]+[17-18]
Rather than displayin the the sum of these fields I am getting
the
number
from each field output, ie, 101010101010101010101010.
What is wrong with my formula?
Thanks for the help
Tommy