Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display top date value in report

Status
Not open for further replies.

jmhicsupt

MIS
Oct 22, 2005
49
0
0
US
I have a report based off of a query. In the query is a field [EECommentDate]. In the report, I want to display the latest comment only on the report. How would I do this?

Thanks in advance.
 
Perhaps you could set the control source of a text box to:
[tt]=DLookUp("Comment","qryQuery","EECommentDate=#" & Format(DMax("EECommentDate","qryQuery"),"yyyy-mm-dd") & "#")[/tt]
 
I would create a query that returns the latest value (possibly grouped by some other unknown field) and use the query in the report's record source.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
What would I group the query?

Fieldnames:

EECommentDate (date field that I would want the latest comment)
EEComments (memo field that contains the comment)

QryEEInfo is name of query

Thanks in advance.
 
This query should get the latest comments.
Code:
SELECT EEComments
FROM QryEEINfo
WHERE EECommentDate =(SELECT Max(EECommentDate) FROM QryEEInfo);

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top