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
 

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

Similar Threads

Date Brackets as an IIf statement 3
vlookup for two columns 0
Time Calculations 2
Average interpurchase times 4
DATES - Grouping sets of sequential dates 3
Average 7
Find then highlight in yellow 6
dlookup help 2

Top