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.
Author |
Topic |
Delinda
Constraint Violating Yak Guru
315 Posts |
Posted - 2009-05-02 : 07:55:04
|
Hi,My table as follow,TrnxID | In | Dte--------------------------------------------1 | UM | 4/20/2008 3:36:11 PM2 | UM | 4/20/2008 7:45:56 PM3 | UM | 4/21/2008 2:33:24 PM4 | UM | 4/21/2008 10:02:14 PMHow to display 2nd latest date from above table?My expected result should be3 | UM | 4/21/2008 2:33:24 PM |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-05-02 : 08:18:35
|
Just an idea...select top 1 * from(select top 2 * from table order by Dte DESC) torder by Dte ASC No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-05-02 : 08:20:11
|
This will work only if no Dte is stored twice... No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
Delinda
Constraint Violating Yak Guru
315 Posts |
Posted - 2009-05-04 : 07:10:22
|
tq very much |
|
|
|
|
|