Find an Average

M

Markus

Here is my table
Table1
Date Heads
5/19/04 20
5/20/04 21
5/21/04 22
5/22/04 22

I have a form (MainForm) that I want to run my query from.
It has start date and end date controls. Date1 and End1.
How can I create an exression that would give me the
average number of heads by adding the heads together from
the table depending on the dates entered into the controls
on my form and then dividing by the number of days between
the dates entered in the controls.


Thanks
 
D

dlw

in the query, select the dates using this:
between [forms]![mainform]![date1] and [forms]![mainform]!
[end1]
to get the days between the dates:
datediff(d,[forms]![mainform]![date1],[forms]![mainform]!
[end1])

and so on
 
Top