By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,377 Members | 3,038 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,377 IT Pros & Developers. It's quick & easy.

Query

P: 1
How do I write a query that averages data from weeks 1 through 10? Example: I want to find the average sales for weeks 1 through 10.
Jun 5 '07 #1
Share this Question
Share on Google+
1 Reply


ADezii
Expert 5K+
P: 8,638
How do I write a query that averages data from weeks 1 through 10? Example: I want to find the average sales for weeks 1 through 10.
In the simplest scenario, assuming a Table named tblSales consisting of a [Date] and [Sales] Field, to calculated the Average of Sales for the 1st 10 Weeks:
Expand|Select|Wrap|Line Numbers
  1. SELECT Avg(tblSales.Sales) AS Avg_Sales_Week_1_to_10
  2. FROM tblSales
  3. WHERE Format([Date],"ww") Between 1 And 10;
Jun 5 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.