adding totals across

  • Thread starter Thread starter JA
  • Start date Start date
J

JA

I hope someone can help me. I need to add the numbers in several fields,
going across. I tried this expression:

[field1] + [field2] + [field3] + [field4] + [field5]

but all it did was combine the numbers, rather than add them.

1+3+2+5+3 = 13253 instead of 1+3+2+5+3 = 14

How can I do this, or what is it called? I'm using Access 2000

Thanks, Jill
 
Jill,

The result you got implies that the fields are of type Text rather than
Numeric; you can check that in the table design.
If these fields are for strictly numeric values, the the best thing to do is
change them to numeric in the table design.
If, so some reason (external, imported data etc.) this is not an option,
then try an expression like:
Val([field1]) + Val([field2]) + ...

HTH,
Nikos
 
Nikos,

That did the trick! Thank you.

Jill


Nikos Yannacopoulos said:
Jill,

The result you got implies that the fields are of type Text rather than
Numeric; you can check that in the table design.
If these fields are for strictly numeric values, the the best thing to do is
change them to numeric in the table design.
If, so some reason (external, imported data etc.) this is not an option,
then try an expression like:
Val([field1]) + Val([field2]) + ...

HTH,
Nikos

JA said:
I hope someone can help me. I need to add the numbers in several fields,
going across. I tried this expression:

[field1] + [field2] + [field3] + [field4] + [field5]

but all it did was combine the numbers, rather than add them.

1+3+2+5+3 = 13253 instead of 1+3+2+5+3 = 14

How can I do this, or what is it called? I'm using Access 2000

Thanks, Jill
 
Back
Top