madelca100
MIS
I've read dozens of posts in several Access forums but can't find an answer to this one. (Probably not using the correct descriptors.)
Please read this entire post before responding.
In another life I could write something like this:
Select Max(Field1) WITH Field2, Field3, Field4
group by field5;
This would give me all Field5's maximum Field1 and the other fields from the same record (row).
For example
Field1 Field2 Field3 Field4 Field5
10 20 30 40 mike
20 10 15 20 mike
30 5 20 10 mike
10 60 10 30 fred
20 10 15 20 fred
40 6 5 10 fred
What I'm looking for is:
mike 30 5 20 10
(since 30 is the max of field1 for mike take the other values from the same row even though they are not 'max')
fred 40 6 5 10
(since 40 is the max of field1 for fred)
etc.
Select max(field1) max(field2) etc. will give me the maximum value for each field per person. Not what I want.
mike 30 20 30 40
fred 40 16 15 30
I'm doing this in design query not straight sql (not sure exactly what this is called).
Can this be done in a single pass?
I know I can do this in two steps.
1)make table query with the max(field1) for each name (and key).
2)use that table to fetch the other values.
Apologies if an answer has already been posted. (I did look.) Please point me to it.
mike
Please read this entire post before responding.
In another life I could write something like this:
Select Max(Field1) WITH Field2, Field3, Field4
group by field5;
This would give me all Field5's maximum Field1 and the other fields from the same record (row).
For example
Field1 Field2 Field3 Field4 Field5
10 20 30 40 mike
20 10 15 20 mike
30 5 20 10 mike
10 60 10 30 fred
20 10 15 20 fred
40 6 5 10 fred
What I'm looking for is:
mike 30 5 20 10
(since 30 is the max of field1 for mike take the other values from the same row even though they are not 'max')
fred 40 6 5 10
(since 40 is the max of field1 for fred)
etc.
Select max(field1) max(field2) etc. will give me the maximum value for each field per person. Not what I want.
mike 30 20 30 40
fred 40 16 15 30
I'm doing this in design query not straight sql (not sure exactly what this is called).
Can this be done in a single pass?
I know I can do this in two steps.
1)make table query with the max(field1) for each name (and key).
2)use that table to fetch the other values.
Apologies if an answer has already been posted. (I did look.) Please point me to it.
mike