dMax syntax for multiple criteria not working

  • Thread starter Thread starter Lolie
  • Start date Start date
L

Lolie

Hi,
I'm having a lot of trouble with this syntax. It's supposed to return the
termination_date from the current participant_id's most previous match.

DMax("match_terminated", "tbl_match", "participant_id=" & Me.participant_id
& "AND "match_terminated<" & match_date)

Any ideas greatly appreciated!
 
Assuming that match_date is a date/time field, you need to add date
delimeters. Try;

DMax("match_terminated", "tbl_match", "participant_id = " & Me.participant_id
& " AND match_terminated < #" & match_date & "#")
 
Thank yoU! That worked fantastically!

Beetle said:
Assuming that match_date is a date/time field, you need to add date
delimeters. Try;

DMax("match_terminated", "tbl_match", "participant_id = " & Me.participant_id
& " AND match_terminated < #" & match_date & "#")
 
Hi,
I'm having a lot of trouble with this syntax. It's supposed to return the
termination_date from the current participant_id's most previous match.

DMax("match_terminated", "tbl_match", "participant_id=" & Me.participant_id
& "AND "match_terminated<" & match_date)

Any ideas greatly appreciated!

I assume [Participent_ID] is a Number datatype?

& "AND "
^
You need to include a space after the " and before the word AND.

& "AND "match_terminated<"
^
This " is incorrect. You must include the criteria field
[match_terminated] inside the string. You have it outside.... because
of that incorrect ".
The [Match_date] value is correctly outside the string.

Date datatype values must be surrounded with the date delimiter symbol
#.

DMax("[match_terminated]", "tbl_match", "[participant_id]=" &
Me.[participant_id] & " AND [match_terminated] < #" & [match_date] &
"#")
 
Back
Top