Average by Month

G

Guest

How do I calculate an average by month? I do not want to use a cross tab
query since I just want the row to be the month and the data to be the
average sales for the month.
 
K

Ken Snell \(MVP\)

If you're storing the month and year in separate fields, this is an example
of the query that you'd use:

SELECT Avg(DataField), MonthField, YearField
FROM TableName
GROUP BY MonthField, YearField;


If you're storing the date in a single field, then this is an example of the
query:

SELECT Avg(DataField), Month(DateField), Year(DateField)
FROM TableName
GROUP BY Month(DateField), Year(DateField);
 

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

Calculating Monthly Averages in a Query 1
vba 0
Average of Totals 6
group by month 9
Calculating an Average 11
Report-Chart Wizard-AVG instead of SUM 2
"Rolling" quarterly average 3
need some basic help 4

Top