2 replies
This will give you the 3-day sum of all the meter groups for any 3-day period the user enters into the parameter. If you create a form with a combo box to select Day-1 of the three period, the AfterUpdate event for the combo box could generate the Day-3 for the parameter and run the query.
If the user(s) want a dynamic/rolling 3-Days, such as in a Cross Tab query, that would require a much more involved solution.
SELECT [First] & " - " & [Last] AS 3Days,
tblMeterReading.MeterGroup,
Sum(tblMeterReading.MeterValue) AS SumValues,
First(tblMeterReading.DateRead) AS [First],
Last(tblMeterReading.DateRead) AS [Last]
FROM tblMeterReading
WHERE (((tblMeterReading.DateRead)
Between [enter start date] And [enter end date]))
GROUP BYtblMeterReading.MeterGroup;
The table in my query had 3 fields:
- MeterGroup (Text)
- MeterValue (Number)
- DateRead (Data/Time)
If you create a table with these field names and add some data, you should be able to Cut/Paste the query.
Hope this helps.
by cwlipke
This discussion is closed to new replies.
Trending Software posts
Sort by Trending