Sum Counts in a report

  • Thread starter TraciAnn via AccessMonster.com
  • Start date
T

TraciAnn via AccessMonster.com

Okay, I think I have some major obstacles working against me on this one:

I have a report that is generated from a query using an entered date as a
parameter. The record source has multiple date fields to query against the
entered date.

For Example:
IntroCallDate = [Enter Activity Date] OR
IntroEmailDate = [Enter Activity Date] OR
ReminderCallDate = [Enter Activity Date]

Therefore, the report shows any record where any of the activities occurred
on the entered activity date.

In the Report Footer I have an unbound text control with "=Count(IIf(
[IntroCallDate]=[Enter Activity Date],1,Null))" to give me a count of records
for each date that matches the entered date.

So, in the Report Footer I have a row of Counts (7 columns total).

I sure would like to add a control that would give me a Sum of the Counts,
but without being able to perform function on calculations in a report, I
don't know where to begin.

Please help!
 
M

Marshall Barton

TraciAnn said:
Okay, I think I have some major obstacles working against me on this one:

I have a report that is generated from a query using an entered date as a
parameter. The record source has multiple date fields to query against the
entered date.

For Example:
IntroCallDate = [Enter Activity Date] OR
IntroEmailDate = [Enter Activity Date] OR
ReminderCallDate = [Enter Activity Date]

Therefore, the report shows any record where any of the activities occurred
on the entered activity date.

In the Report Footer I have an unbound text control with "=Count(IIf(
[IntroCallDate]=[Enter Activity Date],1,Null))" to give me a count of records
for each date that matches the entered date.

So, in the Report Footer I have a row of Counts (7 columns total).

I sure would like to add a control that would give me a Sum of the Counts,
but without being able to perform function on calculations in a report, I
don't know where to begin.


Since all the records in the report match the date in one of
the fields, you can count the matching records by using the
expression:
=Count(*)

OTOH, if some records can have multiple fields that match
the date and you want to count each matching field, then use
this kInd of expression:

=txtFirstCount + txtSecondCount + txtThirdCount + ...
 
K

Klatuu

What makes you think you can't use calculations or functions in a report?
You can indeed do both. All you need to do is add a column to show the total
and do the calculation like you would in a form text box using the name of
the controls:

=txtSum1+txtSum2+txtSum3....
and so on
 
T

TraciAnn via AccessMonster.com

Marshall said:
OTOH, if some records can have multiple fields that match
the date and you want to count each matching field, then use
this kInd of expression:
=txtFirstCount + txtSecondCount + txtThirdCount + ...


Oh my goodness! I feel soooo stupid. I knew the sum function wouldn't work so
I just assumed I couldn't build calculation string. I'm embarrassed.

Thanks Marshall!
 
G

grochef

What makes you think you can't use calculations or functions in a report? 
You can indeed do both.  All you need to do is add a column to show thetotal
and do the calculation like  you would in a form text box using the name of
the controls:

=txtSum1+txtSum2+txtSum3....
and so on
--
Dave Hargis, Microsoft Access MVP



TraciAnn via AccessMonster.com said:
Okay, I think I have some major obstacles working against me on this one:
I have a report that is generated from a query using an entered date asa
parameter. The record source has multiple date fields to query against the
entered date.
For Example:
IntroCallDate = [Enter Activity Date] OR
IntroEmailDate = [Enter Activity Date] OR
ReminderCallDate = [Enter Activity Date]
Therefore, the report shows any record where any of the activities occurred
on the entered activity date.
In the Report Footer I have an unbound text control with "=Count(IIf(
[IntroCallDate]=[Enter Activity Date],1,Null))" to give me a count ofrecords
for each date that matches the entered date.
So, in the Report Footer I have a row of Counts (7 columns total).
I sure would like to add a control that would give me a Sum of the Counts,
but without being able to perform function on calculations in a report,I
don't know where to begin.

- Show quoted text -

How does one get the Sum of a Row in either an Access Query or
Report? I have this situation:

Facility Item1 Item2 Item3 Item4
Facility1 2 4 6 2
Facility2 3 1 10 8

I would like to get the sum of Items 1-4 for each Facility (eg. Total1
14, Total2 22)

Facility Item1 Item2 Item3 Item4 Total
Facility1 2 4 6 2 14
Facility2 3 1 10 8 22

Thank you,
Gregg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top