April 9, 2003 at 9:20 am
Do you know what code you would use for the following :
1234567801/20/2003
1234567808/10/2002
1234567804/02/2002
4567890101/30/2003
4567890102/15/2002
I want to get just the first account with the most current date and exclude the other records
1234567801/20/2003
4567890101/30/2003
April 9, 2003 at 9:30 am
think it goes something like this:
Select a.col1, a.col2 from table1 a where
a.col2 = (select top 1 col2 from table1 where a.col1 = col1 order by col2 desc)
Gregory Larsen, DBA
If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples
Gregory A. Larsen, MVP
April 9, 2003 at 9:34 am
SELECT ACC,MAX(ACCDATE) FROM tablename GROUP BY ACC
April 9, 2003 at 12:59 pm
Thanks for the information
Rocko..
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply