I have a query that at times may have 2 rows with the same ID, but only one of those rows needs to be returned based on the date stamp on the file (only when there are multiple rows with the same id). Below is sample data:
A B C D E F G H I J K L M N O
2741 501304 Joe Spellman 32.38 % Monthly USD Rice CO01 LA 9/24/2010 O
2741 501304 Joe Spellman 45.15 % Monthly COP Travel CO01 LA Change Correction 9/25/2010 N
2742 501304 Dave Jammer 1500.45 Amount Monthly Hotel CO01 AG Change Typo 9/25/2010 N
2742 501304 Dave Jammer Amount Monthly Hotel CO01 AG 9/24/2010 O
2743 501304 Bill Left 1416.67 Amount Monthly USD Expenses CO01 AG 9/24/2010 O
For 2741 I only want the row with the latest date to show.. However if I do a MAX on the ID or date it requires me to group the rest of the columns which in turn leaves both rows in the report?
Any advice on how to accomplish this would be great!!
What I need is to only return one row per ID based on the most recent record. All rows are timestamped as to when the data is imported.. The only columns that will NEVER change are A, B, C, and D.
Thanks a million
A B C D E F G H I J K L M N O
2741 501304 Joe Spellman 32.38 % Monthly USD Rice CO01 LA 9/24/2010 O
2741 501304 Joe Spellman 45.15 % Monthly COP Travel CO01 LA Change Correction 9/25/2010 N
2742 501304 Dave Jammer 1500.45 Amount Monthly Hotel CO01 AG Change Typo 9/25/2010 N
2742 501304 Dave Jammer Amount Monthly Hotel CO01 AG 9/24/2010 O
2743 501304 Bill Left 1416.67 Amount Monthly USD Expenses CO01 AG 9/24/2010 O
For 2741 I only want the row with the latest date to show.. However if I do a MAX on the ID or date it requires me to group the rest of the columns which in turn leaves both rows in the report?
Any advice on how to accomplish this would be great!!
What I need is to only return one row per ID based on the most recent record. All rows are timestamped as to when the data is imported.. The only columns that will NEVER change are A, B, C, and D.
Thanks a million