Summing and averaging columns

  • Thread starter Thread starter shaggles
  • Start date Start date
S

shaggles

I'm creating an exam in access and I want to sum the
columns in each section and then create a weighted average
for each section score. It seems like all the sum and
average functions are act on one column. I tried doing
this: [Column1]+[Column2]+[Column3] but that just gave me
the contents of each column lined up in a row.
 
Sum, Avg and the other aggregate functions work vertically (down a column), not
horizontally (across a row/record).

If you are doing arithmetic and getting concatenation ( 1+2+3 =6 versus 1+2+3 =
123) Then Access is probably seeing the field values as text vice numeric. You
can try

Val(Nz(Column1,0)) + Val(Nz(Column2,0)) + ...

Val forces the number characters in the field to a number type, while NZ handles
the situation of the field containing a null value.
 
Back
Top