PaulA
04-02-2002, 11:42 AM
I am trying to query whole records from from a table based on using the "total" row in the query design view. I want one record per identifying field (Patient ID) and based on the max value of a second field. However, I want all acompaning field values of that specific record. Using "group" or "first" and "last" functions for the other fields will often bring up a value from a different record for the same patient ID. Any suggestions?
Thanks.
AnnPhil
04-02-2002, 12:15 PM
You need to build two queries. the first query should have the identifying field (Patient ID) and the second field that you want the max value. Turn on the Totals feature and group by identifying field (Patient ID) and then max for the second field. Save query. Create second query based on the same table and the query you just build. Make sure they are joined with the identifying field (Patient ID) . Bring down the additional fields from the table and run the query.
Hope this helps