Solved

ms access query help to perform davg

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

Accepted Solution

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
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…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now