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 |
|
dungla
Starting Member
2 Posts |
Posted - 2008-09-10 : 00:43:59
|
| Hi there,I've 2 records:ID Date Value1 Value2584 2008-07-01 00:00:00.000 4000 0 584 2008-08-01 00:00:00.000 5000 0 How can I select the record which have greater date (2008-08-01)?LAD |
|
|
hey001us
Posting Yak Master
185 Posts |
Posted - 2008-09-10 : 00:48:59
|
| SELECT * FROM Table WHERE Date in (SELECT MAX(Date) from Table)hey |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-09-10 : 00:52:55
|
[code]select top 1 *from yourtableorder by Date desc[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-09-10 : 03:44:49
|
| select t.* from(select *,row_number() over (order by date desc) as sno from yourtable) as twhere sno=1MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|