Coding 30 day average

G

gemini2

I hope someone can help me. I need to create a text box on a for
that will display a running 30-day average of a field. How would
code this so that each day the maximum number of days it use t
calculate the average is 30. :?
 
T

tina

you could try using a DSum() function, where the criteria selects records
based on a date field in each record, something like

=DSum("[NumberField]", "MyTable", "[DateField] Between #" & Date() & "# And
#" & Date()-30 & "#") / 30

hth
 
Top