averaging date fields

L

linda

I have a field that calculates the difference between two
other date fields within the detail section of my report
and I need to add a field in the group footer that gives
me an average for the date calculation field at the end of
each group.

Ex:

Community1
id date1-date2 (25)
id date1-date2 (35)
____
60
________________________

average 30

Community2
id date1-date2
. . . and so on

I've tried =Sum([fieldName1])
then =Avg([nameOfSumField])

Pleeeeasse help me.

Thanks!!!!!!!!
 
M

MGFoster

linda said:
I have a field that calculates the difference between two
other date fields within the detail section of my report
and I need to add a field in the group footer that gives
me an average for the date calculation field at the end of
each group.

Ex:

Community1
id date1-date2 (25)
id date1-date2 (35)
____
60
________________________

average 30

Community2
id date1-date2
. . . and so on

I've tried =Sum([fieldName1])
then =Avg([nameOfSumField])

You need to add an invisible TextBox that stores the running sum of the
calculated field.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[Untested suggestion:]

Open the report in design view.

Next to the Calculated control place a TextBox named txtDateSum.

Set its Visible property to False.

Set the ControlSource to something like this:

=[calculated field]

Where [calcualted field] is the name of the TextBox that is
calculating the difference between the two dates.

Set the Running Sum property to Over Group.

In the Group Footer place a TextBox under the calculated field.

Set its ControlSource to:

=[txtDateSum]

This will retrieve the running sum of the date calculation.

To get the Average:

Place a TextBox somewhere on the same Group Footer.

Set its Control Source to:

=[txtDateSum] / Count(*)


MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQE+GcoechKqOuFEgEQIvGACg9ArULpmN5m9y2jeg8bMrfH3ox5AAoKVe
skz8Xox3D1Rs8e4pfue8QPBb
=x/7c
-----END PGP SIGNATURE-----
 

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