dbTalk Databases Forums  

Summing yes/no fields

comp.database.ms-access comp.database.ms-access


Discuss Summing yes/no fields in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Susan
 
Posts: n/a

Default Summing yes/no fields - 10-18-2005 , 12:46 PM






I have tried summing yes/no fields and always end up with negative numbers
instead of positive numbers. What do you suggest?

Susan



Reply With Quote
  #2  
Old   
Evy Leach
 
Posts: n/a

Default Re: Summing yes/no fields - 02-02-2006 , 05:10 PM







I don't think you can do this in a form but you might be able to do it in a
report.
Try the Count() function. Use the If Else Then to determine what you want
to count.

The value of a yes/no field is:

yes = -1
no = 0

I think this is why you are always getting a negative number. I don't think
you want to sum the value, instead you want to count home times the field is
equal to -1 or 0.

I hope this helps.

Evy

"Susan" <HMcKeithan (AT) comcast (DOT) net> wrote

Quote:
I have tried summing yes/no fields and always end up with negative numbers
instead of positive numbers. What do you suggest?

Susan






Reply With Quote
  #3  
Old   
Del
 
Posts: n/a

Default Re: Summing yes/no fields - 02-03-2006 , 04:42 AM



In your query repalce your yes / no column with this;

NewColumnName: IIf([MyyesnoName]<>0,1,0)

NewColumnName is any name you want to call it (Has to be different
than the exisitng Yes / No column name)
MyyesnoName is the name of your Yes / No column in the table.

What this will do is if the value of your yes / no column is -1 then
this column will be 1 for all others it will be 0

Then your sun this column instead of your yes / no column.

--------------------------------------------------------------------------------------------------------------------------------------------


On Thu, 2 Feb 2006 18:10:29 -0500, "Evy Leach" <sysmgr (AT) altira (DOT) com>
wrote:

Quote:
I don't think you can do this in a form but you might be able to do it in a
report.
Try the Count() function. Use the If Else Then to determine what you want
to count.

The value of a yes/no field is:

yes = -1
no = 0

I think this is why you are always getting a negative number. I don't think
you want to sum the value, instead you want to count home times the field is
equal to -1 or 0.

I hope this helps.

Evy

"Susan" <HMcKeithan (AT) comcast (DOT) net> wrote in message
news:WrCdnTipPOaXqMjeRVn-sA (AT) comcast (DOT) com...

I have tried summing yes/no fields and always end up with negative numbers
instead of positive numbers. What do you suggest?

Susan




Regards,
Del LaBo
Rittman, Ohio
dlabo (AT) neo (DOT) rr.com


Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.