By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,064 Members | 1,542 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,064 IT Pros & Developers. It's quick & easy.

Running Average in MS ACCESS Query.

P: 5
Hello,

I have actually asked this before but can't find it on the site (I'm still new here). I have got numerical data coming into my database twice a day for each specific subject that is being measured. When my project gets going it will continue for > 6 months so it will be a lot of data in the end. I need to create a running average of the numerical data for each subject for the last 7 days. This needs to be a continous evaluation and not just once off. I need the running average for that subject every day. Can anybody help me with this. I have tried using "Todays Date" - 7 days in a query but that doesn't account for days not measured (eg weekends) What I need is the last 7 "Measured" days.

Thanks for your help in advance,

John
Mar 12 '07 #1
Share this Question
Share on Google+
3 Replies


Rabbit
Expert Mod 10K+
P: 12,366
In the criteria
Expand|Select|Wrap|Line Numbers
  1. >= iif(Day(Date()) = 2, Date - 11, Date - 9)
Mar 12 '07 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
Hello,

I have actually asked this before but can't find it on the site (I'm still new here).
John

To find your previous posts either go to control panel at top RHS of page and look in List Subscriptions or click on your name to take your into your profile where you will be able to access a list of all questions and all posts.

Mary
Mar 12 '07 #3

NeoPa
Expert Mod 15k+
P: 31,494
Hello,

I have actually asked this before but can't find it on the site (I'm still new here). I have got numerical data coming into my database twice a day for each specific subject that is being measured. When my project gets going it will continue for > 6 months so it will be a lot of data in the end. I need to create a running average of the numerical data for each subject for the last 7 days. This needs to be a continous evaluation and not just once off. I need the running average for that subject every day. Can anybody help me with this. I have tried using "Todays Date" - 7 days in a query but that doesn't account for days not measured (eg weekends) What I need is the last 7 "Measured" days.

Thanks for your help in advance,

John
John,

Your previous thread on the subject (Running Average).
I suspect that if you provide us with details of how your data is stored (Table MetaData) then someone could give you some help returning this information in a query. An example layout for the MetaData follows :


Table Name=tblStudent
Expand|Select|Wrap|Line Numbers
  1. Field; Type; IndexInfo
  2. StudentID; AutoNumber; PK
  3. Family; String; FK
  4. Name; String
  5. University; String; FK
  6. Mark; Numeric
  7. LastAttendance; Date/Time
Mar 13 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.