Total fields in a row

G

Guest

I have a Query which is calculating 10 different values in a record. I need
to then sum these 10 values within each row. When I attempt to total them, I
get a concatenation instead of a summed total. Here's my formula:
TotalCorrect:
[Score1]+[Score2]+[Score3]+[Score4]+[Score5]+[Score6]+[Score7]+[Score8]+[Score9]+[Score10]
Each "Score" field is a calculated field on the query, is this why it
concatenates instead of summing? Thanks in advance for any help you can give
me.
 
J

Joseph Meehan

Jason said:
I have a Query which is calculating 10 different values in a record. I
need
to then sum these 10 values within each row. When I attempt to total
them,
I get a concatenation instead of a summed total. Here's my formula:
TotalCorrect:
[Score1]+[Score2]+[Score3]+[Score4]+[Score5]+[Score6]+[Score7]+[Score8]+[Score9]+[Score10]
Each "Score" field is a calculated field on the query, is this why it
concatenates instead of summing? Thanks in advance for any help you can
give me.

Why not try going to the query and in a single field do all the
calculating and adding in one step.

You may be right about why your formula is not working, but I don't
know.
 
G

Guest

Each "Score" field is comparing two values and then showing a 1 or 0. The
total needs to be in a seperate field because it has to add up all of the 1's
that are shown from the comparisons. Becasue of this, I don't think I can do
it all in the same field.

Joseph Meehan said:
Jason said:
I have a Query which is calculating 10 different values in a record. I
need
to then sum these 10 values within each row. When I attempt to total
them,
I get a concatenation instead of a summed total. Here's my formula:
TotalCorrect:
[Score1]+[Score2]+[Score3]+[Score4]+[Score5]+[Score6]+[Score7]+[Score8]+[Score9]+[Score10]
Each "Score" field is a calculated field on the query, is this why it
concatenates instead of summing? Thanks in advance for any help you can
give me.

Why not try going to the query and in a single field do all the
calculating and adding in one step.

You may be right about why your formula is not working, but I don't
know.
 
L

Lynn Trapp

It is concatenating the fields because they are of type TEXT instead of type
Number. If you can change the datatype to number you should get a different
result. If you can't change the datatype then you can use the Val()
function:

TotalCorrect: Val([Score1]) + Val([Score2]) + Val([Score3]).....
 
J

Joseph Meehan

Lynn said:
It is concatenating the fields because they are of type TEXT instead of
type
Number. If you can change the datatype to number you should get a
different
result. If you can't change the datatype then you can use the Val()
function:

TotalCorrect: Val([Score1]) + Val([Score2]) + Val([Score3]).....

I should have remembered the use of Val.
Jason said:
I have a Query which is calculating 10 different values in a record. I
need to then sum these 10 values within each row. When I attempt to
total
them, I get a concatenation instead of a summed total. Here's my
formula:
TotalCorrect:
[Score1]+[Score2]+[Score3]+[Score4]+[Score5]+[Score6]+[Score7]+[Score8]+[Sco
re9]+[Score10]
Each "Score" field is a calculated field on the query, is this why it
concatenates instead of summing? Thanks in advance for any help you can
give me.
 
J

Joseph Meehan

Jason said:
Each "Score" field is comparing two values and then showing a 1 or 0. The
total needs to be in a seperate field because it has to add up all of the
1's that are shown from the comparisons. Becasue of this, I don't think I
can do it all in the same field.

Joseph Meehan said:
Jason said:
I have a Query which is calculating 10 different values in a record. I
need
to then sum these 10 values within each row. When I attempt to total
them,
I get a concatenation instead of a summed total. Here's my formula:
TotalCorrect:
[Score1]+[Score2]+[Score3]+[Score4]+[Score5]+[Score6]+[Score7]+[Score8]+[Score9]+[Score10]
Each "Score" field is a calculated field on the query, is this why it
concatenates instead of summing? Thanks in advance for any help you can
give me.

Why not try going to the query and in a single field do all the
calculating and adding in one step.

You may be right about why your formula is not working, but I don't
know.

Sure you can. It can go something like this:

In the Filed line of a blank column of a query:

NameForResult: ([PartA1] *
[PartB1])+([PartA2]*[PartB2])+([PartA3]*[PartB3])+....+([PartA10]*[PartB10])

Assuming your calculation is multiplying fields PartA times fields PartB.
You can press Shift F2 to give yourself a larger area to type the expression
in.
 
L

Lynn Trapp

I should have remembered the use of Val.
It was mostly a guess on my part -- adding text values will always produce a
concatenation.
 
S

Steve Huff

Try converting each on to a number (int or double as needed) for example:

TotalCorrect: CDbl([Score1])+CDbl([Score2])+ etc...

--Steve Huff
 

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