Count Missing Elements

Kila

Registered User.
Local time
Today, 01:39
Joined
Mar 5, 2003
Messages
275
I am trying to create a slightly complicated report from some very simple data.
I have a database where we are documenting the date that each of 6 mandatory elements were completed on each patient admission. In my report, I am trying to display the number of cases that were missing x elements each day...for example, on 1/15/05, there were:
5 cases were missing 3 elements
7 cases were missing 2 elements
3 cases were missing 1 element
10 cases were missing 0 elements

Thus far, my report displays
- The total number of cases each day
- The total number of each element completed each day
- A list of each element (present or absent) displayed for each case
(this is only for calculation purposes, it will eventually be invisible)
- A count of the number of missing elements for each case.

I am ultimately trying to sum up this last item like the sample data listed above in my footer. However, my calculation for this gives me an error...

=DCount("[indvSum]","rptAdmissionData","[AdmissionDate]=[txtAdmissionDate] AND [indvSum]='1'")

(for this particular example, I am trying to find all the cases missing 1 element on a given date)

Any suggestions on what is wrong with this? I am guessing maybe you can't use DCount to look at a Detail-level control in the same report.

Thanks for any assistance you can offer!
 
Last edited:
Iif did not work either...

On a whim, I tried

=IIf([AdmissionDate]=[txtAdmissionDate] And [indvSum]=1,Count([txtCounter]),0)

(txtCounter being a control that counts each line in the Detail section)

However, it keeps asking me to enter "txtCounter" when I run the report.

Please help!
 
Each time I do a little more research and my statement gets simpler, but it STILL does not work. Now I have in my Date Footer:

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

([indvSum] is a field in the detail area)

But it KEEPS prompting for [indvSum] when I run it. Why does it not recognize a field from within the same report?

Thanks in advance...
 
Can anyone offer any assistance? Thanks!
 
Is indvSum a field in the underlying record source or a calculated field?
 
It is a calculated field whose name is unique to the report. [AdmissionDate] is a field in the table, and [txtAdmissionDate] is a field a grouper in the report that references [AdmissionDate] in the table.

Thanks.
 

Users who are viewing this thread

Back
Top Bottom