Re: Report Group Footer not displaying the total that I want
- From: "Wayne Morgan" <comprev_gothroughthenewsgroup@xxxxxxxxxxx>
- Date: Mon, 01 Aug 2005 14:55:59 GMT
One option is to use the built in running sum property (data tab) of a
textbox when it is on a report. To get a count, you can set the Control
Source of the textbox to =1 and set its Running Sum property to Over All or
Over Group. If you want to count only if the value of another field is a
certain value, you can use an IIf statement instead of =1, such as
=IIf([txtOtherTextbox]="Hello", 1, 0). This will count the number of records
that have Hello in txtOtherTextbox. In the group footer, place a textbox
with its Control Source pointing to the summing textbox in the detail
section
=txtMySummingTextbox
--
Wayne Morgan
MS Access MVP
"SueB" <slbrick@xxxxxxxxxxx> wrote in message
news:lNpHe.3$sE.222@xxxxxxxxxxxxxxxxxx
> Greetings. I have a report based on the following query (hang in there
> .. it's quite long):
>
> SELECT Year([tblEvents].[eventstartdt]) AS Yr, tblEvents.eventID,
> tblEvents.eventname, tblEvents.eventhost, tblEvents.eventcity,
> tblEvents.eventstate, tblEvents.eventstartdt, tblEvents.eventenddt,
> tblTrials.trialnbr, tblTrials.trialdt, tblTrialClass.trialclassID,
> tblClasses.class, tblScores.score, tblScores.level, [tblPeople].[fname]
> & (" "+[tblPeople].[midinit]+".") & " " & [tblPeople].[lname] & ("
> "+[tblPeople].[suffix]+".") & " (" & [tblPeople].[city] & ", " &
> [tblPeople].[state] & ")" AS judge, tblScores.qualified
> FROM (tblEvents INNER JOIN tblTrials ON tblEvents.eventID =
> tblTrials.eventID) INNER JOIN (((tblPeople INNER JOIN tblJudges ON
> tblPeople.peopleID = tblJudges.peopleID) INNER JOIN (tblClasses INNER
> JOIN tblTrialClass ON tblClasses.classID = tblTrialClass.classID) ON
> tblJudges.judgeID = tblTrialClass.judgeID) INNER JOIN tblScores ON
> tblTrialClass.trialclassID = tblScores.trialclassID) ON
> tblTrials.trialID = tblTrialClass.trialID
> ORDER BY Year([tblEvents].[eventstartdt]), tblEvents.eventstartdt,
> tblTrials.trialnbr, tblClasses.classID, tblScores.level;
>
>
> The report is sorted (ascending) and grouped by:
> Yr
> eventstartdt
> eventname
> trialnbr
> class
>
> There can be many events in a yr
> there can be many trials in an event
> there can be three classes in a trial
>
> I want to display the following in the Yr Footer (year end totals):
>
> # of Events
> # of Trials (total)
> Avg # of Trials in an Event
> Max # of Trials in an Event
>
> The problem: each record in the recordset is basically a "score" that
> was recorded for a dog competing in a trial which is in an event. So
> there are many records with the same eventname/eventID. For my test data
> the number of records is 32. When I used =Count([eventID]) for the
> ControlSource of the textbox for "# of Events" (in the Yr Footer) the
> result was 32 instead of 2 (there are 2 events in my test data).
>
> What I really want is something like =Count(distinct [eventID]) but that
> is not a valid construct. Any ideas how to get the results I want in
> this report? Or do I need a different report (i.e.; a different query)?
>
> Thanks.
>
> Regards,
> SueB
>
> *** Sent via Developersdex http://www.developersdex.com ***
.
- Follow-Ups:
- References:
- Prev by Date: Re: Read only version of a form.
- Next by Date: Re: Report Group Footer not displaying the total that I want
- Previous by thread: Report Group Footer not displaying the total that I want
- Next by thread: Re: Report Group Footer not displaying the total that I want
- Index(es):
Relevant Pages
|