Criteria help

  • Thread starter Thread starter Peggy
  • Start date Start date
P

Peggy

I know what this in the criteria returns.

DMax("[EventDate]","Detail"

What can I put in the CustomerID criteria to give me the
above for each CustomerID?

???("[CustomerID]","Customers")
 
Peggy,

I think you are going to need to give some more information if you want
a useful answer. What tables and fields are you working with here, and
what are you trying to achieve? Posting the SQL view of the query is
often helpful, as is giving examples.
 
You could do
Dim MyMaxDate as Date
MyMaxDate = DMax("[EventDate]","Detail"
msgbox DLookup ("[CustomerID]","Customers","[EventDate] = '" &
Format$(MyMaxDate, "ddmmmyyyy") & "'")
 
I know what this in the criteria returns.

DMax("[EventDate]","Detail"

What can I put in the CustomerID criteria to give me the
above for each CustomerID?

???("[CustomerID]","Customers")

Not knowing anything about the structure of your tables, this is a WAG
but...

a criterion on EventDate of

=DMax("[EventDate]", "[Detail]", "[CustomerID] = " & [CustomerID])

may work (assumptions: the Detail table is the table you're searching;
it has a numeric CustomerID field, and you want the most recent event
for each customer).
 
Back
Top