Need to Average Data on Form by Date

  • Thread starter Thread starter Susy
  • Start date Start date
S

Susy

I have a form that occasionally has more than one record
for a certain date. I need to average these duplicates so
that I can graph the data. Can I do this in a control on
the form?

DTW Date
16.25 2/1/03
17.00 2/2/03 ---
15.26 2/3/03 --- Can I average these three by date?
17.11 2/3/03 ---
19.00 2/3/03
14.22 2/4/03

Would I use DAvg([DTW]) in the expression? I just don't
know how to specify that it average only when the date is
duplicated.

Thank you.
 
You can average these in a query that groups the data by date and averages
the amount. To do this, go to the <Queries> tab, create a new query and add
your table. Click <View>, <Totals>. Add your two fields and on your amount
field, choose <Avg> as your total. The SQL of your query will be like:

SELECT Table1.Date, Avg(Table1.Amount) AS AvgOfAmount
FROM Table1
GROUP BY Table1.Date;

RB
 
Back
Top