Counted Field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I set up the table that has field named CCA. Its data type is YES/NO. Is it
posible to count how many Yes or how many No in the forms or reports?
Please show me if it is Ok to make a total.

If it is not, do I need to change its data type to NUMBER?

Thanks
Chi Huynh
 
Access stores a Yes/No field as minus one or a zero. If you sum the field
the Yeses will total as a negative sum. Use function INT to remove the sign
like --
Int(Sum([YourField])
 
Use the DCount function

lngYes = DCount("[CCA]", "MyTableName", "[CCA] = -1 ")
lngNo = DCount("[CCA]", "MyTableName", "[CCA] = 0 ")
 
Back
Top