Matching unbound record with active year

W

Wylie C

I have an unbound calculated control that gets a summed value from a query.
When the user uses the form to edit data, I would like the data to refelect
the totals for the current year shown on the forms. The control on the form
storing the date is StatDate and the unbound control code is:

=DLookUp("[Total Miles]","Years Mileage")

My query looks like this:

SELECT DISTINCTROW Year([Statistics].[StatDate]) AS [Year],
Sum(Statistics.Mileage) AS [Timed Miles Ridden], Sum(Statistics.[Total
Miles]) AS [All Miles Ridden]
FROM Statistics
GROUP BY Year([Statistics].[StatDate]),
Format$([Statistics].[StatDate],'yyyy')
ORDER BY Year([Statistics].[StatDate]) DESC;

Thank you all very much.
 

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

Top