Solved

ms access query help to perform davg

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

21 Experts available now in Live!

Get 1:1 Help Now