Formula help

R

RC

Have a query with 3 fields: ID, Inspect_Date, and
Last_Date. Last_Date is a calculated field that examines
all the dates listed in Inspect_Date, finds the latest
date, and then puts a "Y" in the column corresponding to
the last date. The results look like this:

ID Inspect_Date Last_Date
1 01/18/2003
1 01/19/2003
2 01/19/2003
2 01/20/2003
3 01/19/2003
3 01/21/2003
3 01/31/2003 Y

The formula that works to accomplish this is:
Last_Date: IIf(DMax("[Inspect_DATE]","INSPECTIONS")=
[Inspect_DATE],"Y","")

But what I need to find is the latest date FOR EACH ID
NUMBER, not just the latest date in the table. Here is the
result I am looking for:

ID Inspect_Date Last_Date
1 01/18/2003
1 01/19/2003 Y
2 01/19/2003
2 01/20/2003 Y
3 01/19/2003
3 01/21/2003
3 01/31/2003 Y

Does anyone know how to rewrite my formula to accomplish
this?

TIA,

RC
 
K

Ken Snell

Try this:

Last_Date: IIf(DMax("[Inspect_DATE]","INSPECTIONS", "[ID]=" & [ID])=
[Inspect_DATE],"Y","")
 
F

Fredg

Add a Where clause to the DMax() function.
Air code:
See if this works....

Last_Date: IIf(DMax("[Inspect_DATE]","INSPECTIONS","[ID] = " &
[ID])=[Inspect_DATE] ,"Y","")
 

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

Similar Threads


Top