Difficult DMax expression?

L

Leslie Isaacs

Hello All

I have three tables, called [staffs] and [x confirmed] and [practices].

Each record in [staffs] represents a person, and each belongs to a
'practice' (so the field 'practice' in [staffs] is related to the field
'prac_name' in table [practices]. Table [x confirmed] contains lots of
records for each person, and contains the field [staff_name] (related to the
corresponding field in [staffs]) and also a field called [month_name], and
also a date/time field called 'entered'.

I need to show (in a text box on a form) the highest value of the field
'entered' in table [x confirmed] where:
the field [month_name] in table [x confirmed] =
[forms]![frm_x_main]![monthname]
but also ...
I need to further restrict this criteria by only considering those people in
[x confirmed] who belong to the Practice whose name is displayed in
[forms]![frm_x_main]![practicename].

I'm not sure that I can use DMax for this, because I don't see how I can
specify the further criteria for the field Practice, as this field is not in
the table [x confirmed] - which is the table in which I am looking up the
data.

I how I have explained this adequately, and that someone can help.

Many thanks
Leslie Isaacs
 
M

Michel Walsh

Hi,


You can use DMax on a saved query, which, in turns, take into account
the join between the two tables, and the many criteria.

Hoping it may help,
Vanderghast, Access MVP
 
J

Jack Isaacs

Thanks Michel - I get it now!
Les

Michel Walsh said:
Hi,


You can use DMax on a saved query, which, in turns, take into account
the join between the two tables, and the many criteria.

Hoping it may help,
Vanderghast, Access MVP


Leslie Isaacs said:
Hello All

I have three tables, called [staffs] and [x confirmed] and [practices].

Each record in [staffs] represents a person, and each belongs to a
'practice' (so the field 'practice' in [staffs] is related to the field
'prac_name' in table [practices]. Table [x confirmed] contains lots of
records for each person, and contains the field [staff_name] (related to
the
corresponding field in [staffs]) and also a field called [month_name], and
also a date/time field called 'entered'.

I need to show (in a text box on a form) the highest value of the field
'entered' in table [x confirmed] where:
the field [month_name] in table [x confirmed] =
[forms]![frm_x_main]![monthname]
but also ...
I need to further restrict this criteria by only considering those people
in
[x confirmed] who belong to the Practice whose name is displayed in
[forms]![frm_x_main]![practicename].

I'm not sure that I can use DMax for this, because I don't see how I can
specify the further criteria for the field Practice, as this field is not
in
the table [x confirmed] - which is the table in which I am looking up the
data.

I how I have explained this adequately, and that someone can help.

Many thanks
Leslie Isaacs
 

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

Query to find missing data 4
What's wrong with this query?! 5
Slow query 9
Simply query? 9
Slow query 1
Why is my query asking for a paramater? 6
'Count' query not working 5
Query loses records? 5

Top