Greetings,
I am using the following SQL (via External Data option in Excel) to pull records from my database. I need a way to eliminate the "duplicate" ID's
<code>
SELECT appid, UpdateDate FROM dbo.apmv_HistoryAttributeChange a WHERE UpdateDate between '01/01/2009' AND '04/01/2009'
</code>
My result from the above SQL is something like this:
ID32978 1/29/2009 7:16
ID32978 3/11/2009 7:16
ID32982 1/16/2009 7:16
ID32982 1/29/2009 7:16
ID32982 3/15/2009 7:16
I want to remove the duplicate ID's and return just the most current ID record - resulting in this:
ID32978 3/11/2009 7:16
ID32982 3/15/2009 7:16
Anyone know how to change my SQL?
thanks!
I am using the following SQL (via External Data option in Excel) to pull records from my database. I need a way to eliminate the "duplicate" ID's
<code>
SELECT appid, UpdateDate FROM dbo.apmv_HistoryAttributeChange a WHERE UpdateDate between '01/01/2009' AND '04/01/2009'
</code>
My result from the above SQL is something like this:
ID32978 1/29/2009 7:16
ID32978 3/11/2009 7:16
ID32982 1/16/2009 7:16
ID32982 1/29/2009 7:16
ID32982 3/15/2009 7:16
I want to remove the duplicate ID's and return just the most current ID record - resulting in this:
ID32978 3/11/2009 7:16
ID32982 3/15/2009 7:16
Anyone know how to change my SQL?
thanks!