Summing Rows?

Poindexter

Registered User.
Local time
Yesterday, 19:47
Joined
Nov 14, 2008
Messages
14
I am fairly new to Access, so I am sure there is a fairly easy way to do this but I just can not figure it out.
I have data in three tables. Data at different time frames and table that what is being measured. I have run a query that sums all of the data that is being measured by the table it is originally stored in. So the items measured are in the rows and the source tables are the columns. How do I add an additional column that is sum of all of the data in that row?
 
Howzit

In a new field in the queryput something like. I don't actually know if there is any other way???

Code:
TotalRow:[yourFieldA]+[yourField2]+[yourField3]....
 
Last edited:
I tried that, however it says teh expression has invalid syntax. Any other ideas?
 
I would have done it exactly as Kiwiman .... invalid syntax error usually means you either didn't use the correct operator between fields ( = instead of + on accident) or perhaps a semicolon instead of a colon between the variant field name and your expression.

The only other idea I could think of since you are using multiple tables is a repeating field name and since you were having to put those in manually (table1.field1 + field2 + table2.field1) then you might have had a keystroke goof. The long way is to start with Total: [field1]. Run it, if it checks good then add the next field ... Total: [field1] + [field2] ... run it and then the next field ...

-dK
 
Thanks, that seemed to work I think I was missing the table.
 
If you have to do this, your table is not properly structured. you have a repeating group and each of those columns should actually be a row in a table. Do some reading on normalization. In spreadsheets, we think two-dimensionally but with relational databases, we have only one dimension. There are no functions that sum across rows (as there are with Excel) because summing across fields of a row indicates a flawed data structure.
 

Users who are viewing this thread

Back
Top Bottom