Average by Month

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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);
 
Back
Top