Jim Hewson
jm.hwsn at gmail.com
Tue Mar 12 15:12:04 CDT 2013
You could filter the data using the MONTH(date) function. e.g. in the criteria of the query you can put something like >= month(now())-3 you probably have to have the date field of the data in month format but that's not too difficult. HTH Jim On Tue, Mar 12, 2013 at 2:53 PM, Kaup, Chester < Chester_Kaup at kindermorgan.com> wrote: > I was wondering if it is possible to create a 3 month moving total in a > query. I have had no luck in finding an answer in any searches. Below is > some sample data and what the results should be. Thanks for any ideas. > > SAMPLE DATA > Well Date Oil > 1 1/1/2012 10 > 1 2/1/2012 14 > 1 3/1/2012 8 > 1 4/1/2012 11 > 1 5/1/2012 9 > 1 6/1/2012 13 > 1 7/1/2012 12 > 2 1/1/2012 7 > 2 2/1/2012 20 > 2 3/1/2012 18 > 2 4/1/2012 5 > 2 5/1/2012 9 > 2 6/1/2012 10 > 2 7/1/2012 14 > > INTENDED RESULTS > 1 3/1/2012 32 > 1 4/1/2012 33 > 1 5/1/2012 28 > 1 6/1/2012 33 > 1 7/1/2012 34 > 2 3/1/2012 45 > 2 4/1/2012 43 > etc > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com >