finding max date

tina hayes

Registered User.
Local time
Today, 12:10
Joined
Jul 28, 2004
Messages
37
ok ihopefully i wont make this too complicated to under stand.

i ahev a form which will populate a form from a query. the query is pulling info out a table included int hti sinfo is the date when it was entered. in the criterai of the query i hve added this code
Between [Forms]![Boxes Reviewed]![txtFromDate1] And [Forms]![Boxes Reviewed]![txtToDate1]
whcih means that the date must be between the two differnt dates that must be entered on the form.

the problem is, is that a value can be entered more that once with different dates. i woul dwant the report just to shouw the most recent date. i considered doing a query which requested all max dates from the table and then having a query calling forma query. but i do not know enough on how to get just the most recent date.
so if i wrote a query which held

box num, shelf num, resp_person, and date. what would i have to put int he criteria to only bring back the entery witht he most recent date.

sorry if i have rambled and look forward to your help
 
select [box num], [shelf num], [resp_person], max([date])
from yourtable
where .... between ... and ...
group by [box num], [shelf num], [resp_person]

And try using your spelling checker ;)
 

Users who are viewing this thread

Back
Top Bottom