Can anyone help me with some coding for a textbox in the header of my report that would return the maxdate of the records from the query on which the report is generated? Sorry about the run on sentence! Thank you.
Thanks for the reply. Your advise is appreciated! I used something a little different to format it.
=Format(DMax("DateOfIncident","qryIncidentInvestigationReport"),"yyyy")
DMax() creates another recordset which is not efficient. I wasn't aware you were looking for only the year. I typically open reports with a where condition. The DMax() expression may return the wrong results.
If you want the year only and don't want the inefficiency of another query against your database and want a guaranteed accurate result, use:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.