Addition in a Access 97 query

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

Can I do math in a query?

I forgot to bind one of my text boxes to a field in a
table and I need to be able to add these up. Kind of like
a update query. I know the fields I want to add, just I
want to make sure I can do addition in a query. Here is
what I have so far:

UPDATE tblPlain SET
WHERE (((tblPlain.TotalPoints)=0));
 
Can I do math in a query?

I forgot to bind one of my text boxes to a field in a
table and I need to be able to add these up. Kind of like
a update query. I know the fields I want to add, just I
want to make sure I can do addition in a query. Here is
what I have so far:

UPDATE tblPlain SET
WHERE (((tblPlain.TotalPoints)=0));

Well, you should NOT store sums in any table. Calculate them on the
fly instead! Your example gives us no clue as to what it is that you
want added or how you want the values displayed. If you want to add
values in several fields in the table, you can put an expression in a
vacant Field cell in the query grid:

TotalPoints: [Field1] + [Field2] + [Field3]

If, on the other hand, you want to sum the value of a single field
across multiple records, you can use a Totals query by clicking the
Greek Sigma icon (looks like a sideways W). Group By the field you
want to use for grouping, and Sum the field that you want to add.

Or, if you want to see the values for individual records and also see
their sum, use a Form (or a Report for printing); put a textbox in the
Form or Report Footer with a control source

=Sum([fieldname])

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top