How many?

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

Guest

I'd like to show the percentage of fields that have a certain response within
my report. Specifically, there is a field that is void unless a certain event
takes place within arecord, a which point a date is entered. The dates will
all differ. I want to know how what percentage of records have a date entered
in this field and display this in the report footer. Can it be done?
 
NC_Sue said:
I'd like to show the percentage of fields that have a certain response
within
my report. Specifically, there is a field that is void unless a certain
event
takes place within arecord, a which point a date is entered. The dates
will
all differ. I want to know how what percentage of records have a date
entered
in this field and display this in the report footer. Can it be done?

Sure, create 2 text boxes: ResponseCounter, ResponseFilledCounter

ResponseCounter.ControlSource = 1
ResponseFilledCounter = Iif(isnull(ResponseDateField),0,1)

Set the RunningSum to both text boxes to added up over the whole report.

In the report footer have another text box where the ControlSource is

= "Percentage of Responses that met Critera:
"&Format(ResponseFilledCounter/ResponseCounter,"0.00%")



OR skip all of the above and simply ...



In the report footer have a text box where the ControlSource is

= "Percentage of Responses that met Critera: "&Format(Dcount("*","[Name Of
Table]","[Response Date Field] Is Not Null") / Dcount("*","[Name Of
Table]"),"0.00%"))

-- Ken from Chicago
 
Just create a text box with a control source of something like:

=Sum( (IsNull([DateField])+1 ))/ Count(*)

IsNull([DateField]) will return either -1/True or 0/False. Adding 1 to this
expression creates a value of 0 for Nulls and 1 for dates. Summing that
expression actually counts the number of non-null values in the field.
 
Unless I have misunderstood, I would think that adding a new control with The
following as the control source would suffice

=Count(DateField)/Count(*)

You will have to set format on the control if you want to see a percentage.
 
This worked perfectly - thanks!
--
Thanks for your time!


Duane Hookom said:
Just create a text box with a control source of something like:

=Sum( (IsNull([DateField])+1 ))/ Count(*)

IsNull([DateField]) will return either -1/True or 0/False. Adding 1 to this
expression creates a value of 0 for Nulls and 1 for dates. Summing that
expression actually counts the number of non-null values in the field.

--
Duane Hookom
MS Access MVP
--

NC_Sue said:
I'd like to show the percentage of fields that have a certain response
within
my report. Specifically, there is a field that is void unless a certain
event
takes place within arecord, a which point a date is entered. The dates
will
all differ. I want to know how what percentage of records have a date
entered
in this field and display this in the report footer. Can it be done?
 
Actually, I liked John Spencer's answer better...

--
Duane Hookom
MS Access MVP
--

NC_Sue said:
This worked perfectly - thanks!
--
Thanks for your time!


Duane Hookom said:
Just create a text box with a control source of something like:

=Sum( (IsNull([DateField])+1 ))/ Count(*)

IsNull([DateField]) will return either -1/True or 0/False. Adding 1 to
this
expression creates a value of 0 for Nulls and 1 for dates. Summing that
expression actually counts the number of non-null values in the field.

--
Duane Hookom
MS Access MVP
--

NC_Sue said:
I'd like to show the percentage of fields that have a certain response
within
my report. Specifically, there is a field that is void unless a certain
event
takes place within arecord, a which point a date is entered. The dates
will
all differ. I want to know how what percentage of records have a date
entered
in this field and display this in the report footer. Can it be done?
 
Back
Top