View Single Post
  #1  
Old January 7th, 2010, 07:04 PM posted to microsoft.public.access.tablesdbdesign
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default counting yes in yes/no data types

Do not us Count but Sum like this --
=Abs(Sum([SOP]))
=Abs(Sum([Protocols]))

A 'Yes' is stored as a -1 (minus one) and the Abs function removes the
negative sign.

--
Build a little, test a little.


"Emelda" wrote:

I am having trouble getting a total count in the report footer for yes/no
data types.

For example, if I have a document number as the primary key in one table
containing general information and as the foreign key in a second table
containing document type information and other information. The different
types of documents are listed as checkboxes (yes/no data type) and there can
be more than one document type selected for each document number.

Then in the report footer, I am trying to get a total count of the
individual document types (e.g., SOPs and protocols). I am using
=Count([SOP]) and =Count([Protocols]) with the associated label. Instead of
obtaining a total number of documents for which the checkbox for SOPs is
checked and the total number of documents for which the checkbox for
protocols is checked, it returns a "yes" for both. How can I get Access to
count the documents whose SOP checkbox is checked and return a number value
and make sure it does not include those with a null value?

I figure that there is an easy solution to this, but I seem to be missing it.

Another question is regarding the use of checkboxes compared to using combo
boxes. Are there advantages or disadvantages? It seems that with combo boxes
only one choice can be selected whereas multiple checkboxes can be used.

Thank you in advance.