A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Puts the minus value in sum



 
 
Thread Tools Display Modes
  #1  
Old January 23rd, 2006, 09:50 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default 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  
Old January 23rd, 2006, 10:11 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default 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  
Old January 24th, 2006, 12:21 AM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default 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  
Old January 24th, 2006, 01:37 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 09:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.