Hi
Imagine I have the following set of data relating to properties and the vendors of those properties that are entered into the Diary to show a property's history.
PropertyID Diary Date VendorID
5 2003 - 04 - 23 20
5 2003 - 02 - 05 20
5 2003 - 01 - 02 21
6 2003 - 10 - 14 26
6 2003 - 09 - 21 26
6 2002 - 06 - 09 27
What I would like to do (But can't think how):
I would like to remove the vendor history from this set of data so that the resultant set of data is as follows:
PropertyID Diary Date VendorID
5 2003 - 04 - 23 20
5 2003 - 02 - 05 20
6 2003 - 10 - 14 26
6 2003 - 09 - 21 26
I have tried to achieve this by getting the maximum Diary Date and grouping by PropertyID in the first instance and then trying to join this information back onto the original table. However this will just return me one row for each property. What I want (as shown above) is to return all the rows relating to the most recent vendor.
How can I do this? I have been pulling my hairs out over this one!
Thanks
Nassy
Imagine I have the following set of data relating to properties and the vendors of those properties that are entered into the Diary to show a property's history.
PropertyID Diary Date VendorID
5 2003 - 04 - 23 20
5 2003 - 02 - 05 20
5 2003 - 01 - 02 21
6 2003 - 10 - 14 26
6 2003 - 09 - 21 26
6 2002 - 06 - 09 27
What I would like to do (But can't think how):
I would like to remove the vendor history from this set of data so that the resultant set of data is as follows:
PropertyID Diary Date VendorID
5 2003 - 04 - 23 20
5 2003 - 02 - 05 20
6 2003 - 10 - 14 26
6 2003 - 09 - 21 26
I have tried to achieve this by getting the maximum Diary Date and grouping by PropertyID in the first instance and then trying to join this information back onto the original table. However this will just return me one row for each property. What I want (as shown above) is to return all the rows relating to the most recent vendor.
How can I do this? I have been pulling my hairs out over this one!
Thanks
Nassy