If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Puts the minus value in sum
Hello,
I'm trying to count or sum the field called "RESULTS" depending on the value (e.g. PASS, FAIL, N/A). I've used the "count" function and it did not work. I now use the "sum" function and it returns the correct value but puts the minus in front of the value (e.g. -17, -30 etc.,). Thank you for your help. Control Source =Sum(qryTestsOut.RESULTS="PASS") returns value -20 |
#2
|
|||
|
|||
Puts the minus value in sum
You are probably using Yes/No fields that store data as a zero for No or
False and minus one for Yes or True. When you sum your Yeses it will be a minus number. Change to =Int(Sum(qryTestsOut.RESULTS="PASS")) "skk" wrote: Hello, I'm trying to count or sum the field called "RESULTS" depending on the value (e.g. PASS, FAIL, N/A). I've used the "count" function and it did not work. I now use the "sum" function and it returns the correct value but puts the minus in front of the value (e.g. -17, -30 etc.,). Thank you for your help. Control Source =Sum(qryTestsOut.RESULTS="PASS") returns value -20 |
#3
|
|||
|
|||
Puts the minus value in sum
Make one change to your control source.
=Abs(Sum(qryTestsOut.RESULTS="PASS")) You are summing the result of the boolean test - Results ="Pass". In Access, that returns 0 for false and -1 for True. So adding the Abs (Absolute) function strips off the negative sign. skk wrote: Hello, I'm trying to count or sum the field called "RESULTS" depending on the value (e.g. PASS, FAIL, N/A). I've used the "count" function and it did not work. I now use the "sum" function and it returns the correct value but puts the minus in front of the value (e.g. -17, -30 etc.,). Thank you for your help. Control Source =Sum(qryTestsOut.RESULTS="PASS") returns value -20 |
#4
|
|||
|
|||
Puts the minus value in sum
Thank you John & Karl I appreciate your response. It works!
"John Spencer" wrote: Make one change to your control source. =Abs(Sum(qryTestsOut.RESULTS="PASS")) You are summing the result of the boolean test - Results ="Pass". In Access, that returns 0 for false and -1 for True. So adding the Abs (Absolute) function strips off the negative sign. skk wrote: Hello, I'm trying to count or sum the field called "RESULTS" depending on the value (e.g. PASS, FAIL, N/A). I've used the "count" function and it did not work. I now use the "sum" function and it returns the correct value but puts the minus in front of the value (e.g. -17, -30 etc.,). Thank you for your help. Control Source =Sum(qryTestsOut.RESULTS="PASS") returns value -20 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
converting minus quantities to plus | Paul Bennett | New Users | 4 | November 14th, 2005 10:32 AM |
how to color code a cell in excel if amount reaches a minus | Pat Mineard | General Discussion | 5 | June 16th, 2005 03:48 PM |
Minus plus | Martin P | General Discussion | 5 | June 15th, 2005 11:32 PM |
strip minus signs from right to left | Heather | General Discussion | 2 | April 21st, 2005 05:52 PM |
Formula Calculating Minus Values | Russ | Worksheet Functions | 2 | October 6th, 2003 03:06 PM |