Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum in report footer, too dumb to figure it out. 2

Status
Not open for further replies.

haytatreides

IS-IT--Management
Oct 14, 2003
94
US
i am calculating a difference in dates for each record listed, and i need to total all of the differences at the end of the report. Please someone help the n00b!

hayt
 
Hayt
Let's assume that the report text box that has the date difference is called [txtDateDifference].

In your Report Footer put an unbound text box which has the control source
=Sum([txtDateDifference])

Tom
 
You can't sum a control (text box). You need to sum the expression bound to that control. For instance, if your detail section txtDateDifference is bound to
=DateDiff("d",[Start],[End])
you will need to use:
=Sum(DateDiff("d",[Start],[End]))

Duane
MS Access MVP
 
Duane
You are absolutely right, if the DateDiff is calculated in the report.

My solution was based on the DateDiff in days being calculated in the query and then that calculation brought into the report and the control named [txtDateDifference]. Then that control can be summed.

Sorry. I should have been more clear. My apology.

Tom
 
Tom,
Good alternative. There are a variety of situations where calculations work well in the Record Source of the report as opposed to in the report itself. I generally perform most calcs in the report but that is just a personal preference. I like to see the calcs without opening the record source.

Duane
MS Access MVP
 
Thanks, Duane
There's always more than one way to get what you want, isn't there?

By the way, I have learned lots from viewing your posts, and continue to do so. Thanks.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top