Solved

ms access query help to perform davg

Posted on 2013-12-20
1
302 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
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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
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.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

679 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