Help with query for access report

  • Thread starter Thread starter Matt Campbell
  • Start date Start date
M

Matt Campbell

Hi,

I am having trouble coming up with a query that gives me what i need to
display in an access report. I have an existing query that gives me a date
and a numerical value. Like this:


Date Value
----------------------
7/1/2003 3
7/3/2003 4
7/3/2003 3
7/4/2003 2

What I'm trying to do do is have the average for a day show up in the query
with the value field and the date. Like This:

Date Value AvgValue
--------------------------------
7/1/2003 3 3
7/3/2003 4 3.5
7/3/2003 3 3.5
7/4/2003 2 2

If the query's name is qryAvgValue and the fields are as they are above in
the examples, can anythink of a query that will give me what I need??

Thanks,

Matt
 
Hi

Existing query: qryValue

qryAvg:
Select Date, Avg(Value) As AvgValue From qryValue Group By Date

qryAvgValue:
Select a.Date, a.Value, b.AvgValue From qryValue a, qryAvg b Where
b.Date=a.Date

PS. 'Date' is reserved word in Access, so beter use someting else for field
name.

Arvi Laanemets
 
Back
Top