Sums showing a negative value

SR

Registered User.
Local time
Today, 17:49
Joined
May 1, 2001
Messages
14
I have a query calculating the sum of checked boxes of field 'A' ('letters sent') and the sum of checked boxes of field 'B' (letters received). My sum field is counting the boxes that are checked but showing the values with a negative sign in front?? How do I correct this? Also - could I create an additional field in this query to calculate the percentage% (success rate) #B's checked/#A's checked?
 
Use tha absolute value function - Abs() to convert any number to a positive number:

=Abs(Sum(YourField))

In order to calculate percentages, you need to count the domain so add a calculation that counts everything:

=Count(*)
 
Just to add to Pat's post:

Yes is stored as -1 and no is stored as 0. That's why the sum is negative.
 
neileg said:
Just to add to Pat's post:

Yes is stored as -1 and no is stored as 0. That's why the sum is negative.
Thank-you for your response (its taken me forever to get time to get back to this project...) - dumb question, because I am a "very limited" Access programmer... regarding the ABS function for changing my negative valued sums - where do I use this function? do I put it in the query somewhere? I would like to just format the field in my form to eliminate the negative but I don't know where to put the function/expression (my attempts have not been successful).
Thanks again - SR
 
I showed you how to surround the sum() function with the abs() function. Modify the query. I preceeded the expression with an = because I thought you were talking about a ControlSource.
 

Users who are viewing this thread

Back
Top Bottom