hansretallick
Technical User
I have an Access database which records data relating to company branches on a weekly basis. Some of this data has to be presented on a monthly basis, and I have extracted the 'month' integer from the date to faciltate this. My problem is with a couple of fields where I have to present the values at the last record in any month.
What I need is as follows:
Branch Day Month Year Pipeline PipelineValue
1 27 2 2006 54 36500
2 27 2 2006 76 76000
3 27 2 2006 34 22000
Where the day is the highest recording date in that particular month
The query which I have produced using Max of Day just produces a result with every weekly date listed. How can I just list the results for the last recorded day of the month without the other days appearing.
This is the query
SELECT qryActivitySelectMonth.Branch, Max(qryActivitySelectMonth.Day) AS MaxOfDay, qryActivitySelectMonth.Month, qryActivitySelectMonth.Year, qryActivitySelectMonth.Pipeline, qryActivitySelectMonth.PipelineValue
FROM qryActivitySelectMonth
GROUP BY qryActivitySelectMonth.Branch, qryActivitySelectMonth.Month, qryActivitySelectMonth.Year, qryActivitySelectMonth.Pipeline, qryActivitySelectMonth.PipelineValue, qryActivitySelectMonth.Day
ORDER BY qryActivitySelectMonth.Month, qryActivitySelectMonth.Year;
I would really appreciate any help with this
Hans
What I need is as follows:
Branch Day Month Year Pipeline PipelineValue
1 27 2 2006 54 36500
2 27 2 2006 76 76000
3 27 2 2006 34 22000
Where the day is the highest recording date in that particular month
The query which I have produced using Max of Day just produces a result with every weekly date listed. How can I just list the results for the last recorded day of the month without the other days appearing.
This is the query
SELECT qryActivitySelectMonth.Branch, Max(qryActivitySelectMonth.Day) AS MaxOfDay, qryActivitySelectMonth.Month, qryActivitySelectMonth.Year, qryActivitySelectMonth.Pipeline, qryActivitySelectMonth.PipelineValue
FROM qryActivitySelectMonth
GROUP BY qryActivitySelectMonth.Branch, qryActivitySelectMonth.Month, qryActivitySelectMonth.Year, qryActivitySelectMonth.Pipeline, qryActivitySelectMonth.PipelineValue, qryActivitySelectMonth.Day
ORDER BY qryActivitySelectMonth.Month, qryActivitySelectMonth.Year;
I would really appreciate any help with this
Hans