Sum command on Field displaying - value.

  • Thread starter Thread starter Leon
  • Start date Start date
L

Leon

Please help. I have the following code in a field on one
of my forms. =Sum(
Code:
 Like "C*")

Basically I want it to total all codes beginning with C on
the form. For some reason the value returned is coming up
minus? (Although the figure is correct) For instance -1324
instead of just 1324.

I wondered if I was missing something very simple?

Thanks for any help you might be able to offer.
 
Code must be text if you are using 'Like "C*". One cannot 'sum' on a text
field. Perhaps what you really mean is to count them?

Sum is working because for each record that is like C*, Code will = true.
True in Access is -1; summing them will therefore get you the correct
number, but negative.

Either use Abs() around your expression, or use Count instead.
 
Thanks ever so much.
Regards

Leon
-----Original Message-----
Code must be text if you are using 'Like "C*". One cannot 'sum' on a text
field. Perhaps what you really mean is to count them?

Sum is working because for each record that is like C*, Code will = true.
True in Access is -1; summing them will therefore get you the correct
number, but negative.

Either use Abs() around your expression, or use Count instead.

--
Joan Wild
Microsoft Access MVP

Please help. I have the following code in a field on one
of my forms. =Sum(
Code:
 Like "C*")

Basically I want it to total all codes beginning with C on
the form. For some reason the value returned is coming up
minus? (Although the figure is correct) For instance - 1324
instead of just 1324.

I wondered if I was missing something very simple?

Thanks for any help you might be able to offer.
[/QUOTE]


.
[/QUOTE]
 
Back
Top