Count Y/N records

jeo

Registered User.
Local time
Today, 19:40
Joined
Dec 26, 2002
Messages
299
I have a field on my Project form(form is based on a query) which is called Completed (Y/N). It holds values Y and N.
I’m wondering if there is a way to count how many Projects completed and how many didn’t. I’m not sure how to count just Ys and then just Ns.
Any help would be appreciated.
Thank you!
 
How are you going to present this data? On a form, report, etc?

You could do a dcount(), a totals query, etc...

kh
 
I'm going to put this data on a report.
So many projects completed________
so many project have not completed yet ____________
Also, how would do I do a count query?
Create new values in it?
 
Last edited:
Q1. In your report, will this value be in, say a footer type total section where the actual records(rows) will be printed first? If so, just do a text box and put something like =sum(myFldName). Or if it's the only thing you will have in the report, maybe something like a text box with a dcount() function?

Q2. To do a totals query, just right click in the query grid and select 'Totals'. Then tinker with it to see how it works.

kh
 
I'm thinking somewhere in a txtbox and this is what i have so far:
DCount("[Project_ID]", "qryrptProjectInfo", "[Completed_YN] = 'N'")
something like that?
 
Hi dude,

I got this code from this forum and I don't know it will be useful to you :rolleyes:

=Sum(IIf([fieldname],1,0))


thanks
 
Use this in the Report Footer:

=Abs(Sum([TheControl Source of your Check box]))

If you check box is named chkboxAnswer and its control source is Answer then use Answer not the Name of the check box.
 
jeo said:
I'm thinking somewhere in a txtbox and this is what i have so far:
DCount("[Project_ID]", "qryrptProjectInfo", "[Completed_YN] = 'N'")
something like that?


Looks right to me. Did you try it?

However, Like I said, if you need this to be in a report footer, where the main section of the report has the actual rows of data, you can use the sum() examples. This would be more efficient...

kh
 
Last edited:
I did try this:
DCount("[Project_ID]", "qryrptProjectInfo", "[Completed_YN] = 'N'") and it worked.
Thank you for all your help!
 

Users who are viewing this thread

Back
Top Bottom