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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Counted Field



 
 
Thread Tools Display Modes
  #1  
Old February 15th, 2006, 03:39 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Counted Field

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



  #2  
Old February 15th, 2006, 04:35 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Counted Field

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])

"Chi" wrote:

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



  #3  
Old February 15th, 2006, 05:49 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Counted Field

Use the DCount function

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

"Chi" wrote:

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



 




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
Form, Subform, Tab key 2nd_Stage_User Using Forms 17 August 25th, 2006 12:30 AM
LOOKUP FOR A VALUE ON A TABLE Samora New Users 9 February 22nd, 2005 01:06 PM
New Record Update Michelle Using Forms 5 October 28th, 2004 07:59 AM
field manipulation Steve Running & Setting Up Queries 2 May 28th, 2004 03:12 PM
Supress blank lines in DOCPROPERTY field Mary Formatting Long Documents 10 May 25th, 2004 07:27 PM


All times are GMT +1. The time now is 09:34 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.