Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help calculating rolling averages between certain date spans

Status
Not open for further replies.

efinnen

Technical User
Feb 21, 2000
55
US
To Whom It May Concern.
First off, anay help or guidance that could be given would be GREATLY appreciated.

Ok here is the situation.

I'm working on something for a public utilities department. I have a query which pulls in flow numbers (monthly) for a certain facility between two date spans.

What I need to do is calculate the average for teh past three months and twelve months for every current month.

I.e. the query pulls in data from 1/1/98 through 1/1/99

The January first Query needs to have a 3 month (and twelve month field) field which would be teh average of Nov 1, Dec 1 and Jan 1. And so on and so forth for all teh rest of teh months in between.

I've tried a couple of different approaches, but to no avail. If I only wanted a 3 and 12 months span for one can get one month fine, but once you give it a span of months it seems to blow up on me.

For those that are potentially interested the code for the singular month query involved DateSerialing back 3 (or 12 Months) and getting a average for that (using the average option form Totals)

Hopefully this makes sense. If anyone has any advice or needs further clarification please feel free to get back in touch with me.

Thanks
Eric




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top