Grouping problem

Mi

Board Regular
Joined
Sep 19, 2004
Messages
77
Hello,
I have the following table:

Person Item Type Date
ABC 1Z IN 2/15/05
ABC 1Z RO 2/16/05
ABC 2Z RI 2/15/05
ABC 3Z RI 2/15/05
ABC 3Z RO 2/16/05

I need a query that will return those Items with the most current date and the type for that record. I tried the use Max in the groupby under Date but can not get it right. I want to return the following:

ABC 1Z RO 2/16/05
ABC 2Z RI 2/15/05
ABC 3Z RO 2/16/05

Any help would be appreciated.

Mi
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi Mi
If you include the 'Type' field then it is trying to group by that too, before working out the max value. You might need to do this with 2 queries. The first query has the person, item and date (max) fields. The second query links the first query to the table (link all 3 fields & select all from the query with matching records from the table) and the 2nd query returns the person, item and date fields from query 1 and the 'type' field from the table.
HTH, Andrew. :)
 
Upvote 0
Thanks,
While I could not get the qry's to link, I was able to get it to work. After looking further into the table, I found a method to their tracking.

Thanks anyways.
Mi
 
Upvote 0

Forum statistics

Threads
1,221,869
Messages
6,162,533
Members
451,773
Latest member
ssmith04

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top