Selecting Min and Max Dates within a given range

G

Guest

First of all let me thank you all for all the great help and advice you gave
me in 2005! Without your help, I would not be able to do my job as
effectively! I TRULY appreciate it!

That being said, my first question of the New Year!

I have a single table that has gauging data for several wells. At the end of
the quarter, I need to run a report that has the total flow in gallons, as
well as the average gallons per minute for each well. So what I need to do is
create a query for each month of the quarter. We get gauging data weekly, the
total flow comes from what is called the totalizer reading, and each week is
larger than the week before, so if I want just the first week's and last
week's reading is there a way to do that? Then I need to know how many days
that is. For example in December, I had dates

12/2 98441900
12/16 99375300
12/23 99987200
12/30 100804545

All I really need is the data from 12/2 and 12/30, then I can do the math
from there.
 
G

Guest

See if this will work for you --
SELECT Table34.Tank, Min(Table34.Field2) AS MinOfField2, Max(Table34.Field2)
AS MaxOfField2, Max([field2])-Min([field2]) AS [Total Flow]
FROM Table34
WHERE (((Table34.Field1) Between #12/1/2005# And #12/31/2005#))
GROUP BY Table34.Tank;

Change Table34 to your table.
ChangeField2 to your metered field.
Change Field1 to your sample date field.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Query Problem 4
Min Max dates not consistent 5
Daily Calculations on a form 2
Calculation between two subreports 2
Form and default dates 9
Max & Min Dates 0
Min/Max Dates and Group By 2
Max; Min & Dates 2

Top