Sum fields in query

G

Guest

Greetings all. I have a query containing fields of numbers of households
engineered which come from one table. For example, there is a field for
single family units (SFU), multiple dwelling untits (MDU), and commercial
units (CU). For one record there might be 100 SFU, 50 MDU, and 10 CU. I
want to add a column in my query to total the quantity in each field for
every record. I tried using the expression builder, but it does not work for
most of the records. I do not know how to write code, so I am limited to the
query tools. Is there something I am leaving out? I want it to look
something like this:

SFU MDU CU Total
100 50 10 160
200 40 20 260

Is this possible? I could not find anything helpful in past posts that did
not entail writing code I did not understand. Thank you in advance.
 
G

Guest

You should not store sums or any other calculated value in a table. You
should calculate the value anew each time you need to display it. So instead
of looking at your table of rental units, you would look at the result of
this query:

SELECT *, SFU+MDU+CDU as SumUnits FROM [NameOfYourTable]
 
G

Guest

Thanks Ted for taking the time to consider my problem. I should have given
more information. I am running this query to generate a report to some VP's,
not to store in a table. After much more searching I found that the reason
my expression did not work for all rows is that some of the fields had null
values, which apparantly is a no-no for calculations.
 

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

Top