Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Second Latest date (Max -1)

Author  Topic 

Richard Branson
Yak Posting Veteran

84 Posts

Posted - 2005-03-01 : 07:57:45
Hi Fellow Code Warriors

I was wondering how one could do the following:

I have a table that has the following data:

Ent_Nbr Date
En1 23/05/2004
En1 25/07/2004
En1 05/08/2004
En1 03/12/2004
EN2 03/01/2004
EN2 18/09/2004
EN2 23/05/2004
EN4 29/04/2004
EN4 03/12/2004
EN4 21/04/2004
EN4 05/08/2004
EN4 23/05/2004
EN4 26/09/2004

What method can I use to select the latest and the the second latest date?

Ent_Nbr Latest Date
Ent_Nbr Second Latest Date

For each ent_nbr

You can't teach an old mouse new clicks.

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-03-01 : 08:00:06
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=46523
Go to Top of Page
   

- Advertisement -