Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Average by Month

Status
Not open for further replies.

MrsMope

Technical User
Oct 18, 2004
125
US
Access 2003
Need to query total quotes by salesperson for a particular time period, my query has the following syntax:
Code:
SELECT api_tblQuotes.Salesperson AS SalesID, user_tblSalesmanProp.Description AS Salesman, Count(api_tblQuotes.[Quote#]) AS [CountOfQuote#], api_tblQuotes.QuoteDate
FROM user_tblAccountProp INNER JOIN (user_tblSalesmanProp INNER JOIN api_tblQuotes ON user_tblSalesmanProp.ID = api_tblQuotes.Salesperson) ON user_tblAccountProp.ID = api_tblQuotes.Acct
GROUP BY api_tblQuotes.Salesperson, user_tblSalesmanProp.Description, api_tblQuotes.QuoteDate;

So I have a complete count of all quotes in the table, I have a form with two textboxes that the date range is inputted, but with the above query if I put a date range in then the count is by day. I also need to calculate the average quotes per month by entire sales department, minus the highest and lowest quote amount.
 
Ok what I did was to create a cross tab query that totaled the count by month. I then added fields to the report footer to total and average each column.

Now, my last part of this is to subtract the highest and lowest number of quotes and get an average on that, what I am thinking is to pull each of those values into an array and do my calculations based on that. Agree? Disagree?














 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top