Solved

ms access query help to perform davg

Posted on 2013-12-20
1
303 Views
Last Modified: 2013-12-20
I need to be able to perform a running average on a column ("IncomingPercent"---number field) based on "WeekEnding", which is a date field.  I have attached the query data output and the query (as a pic and the actual SQL statement).  Really could use expert help with this.  Thanks.


SELECT dbo_InspectionEfficiency.WeekEnding AS WeekEnding, Avg(dbo_InspectionEfficiency.IncomingPercent) AS Incoming, DAvg("IncomingPercent","dbo_InspectionEfficiency",[WeekEnding]<="#" & [WeekEnding] & "#") AS Expr1
FROM dbo_InspectionEfficiency
WHERE (((dbo_InspectionEfficiency.WeekEnding)>=DateSerial(Year(Date()),1,1) And (dbo_InspectionEfficiency.WeekEnding)<DateAdd("d",1,testsat(Date()))))
GROUP BY dbo_InspectionEfficiency.WeekEnding
ORDER BY dbo_InspectionEfficiency.WeekEnding;
1.gif
2.gif
0
Comment
Question by:sxxgupta
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 40

Accepted Solution

by:
als315 earned 500 total points
ID: 39732313
At least you should change
[WeekEnding]<="#" & [WeekEnding] & "#"
to
"[WeekEnding]<=#" & [WeekEnding] & "#"
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question