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 |
|
MageshkumarM
Yak Posting Veteran
61 Posts |
Posted - 2012-02-24 : 02:00:59
|
| Hi all,I have a doubt with this.Table dataidno date particulare 1 12/01/2012 A2 13/01/2012 B3 14/01/2012 CI want to find the max date and show the idno.Thanks,Magesh.Mhttp://mageshkumarm.blogspot.com/ |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-02-24 : 02:37:12
|
[code]select top 1 * from data order by date desc[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
Azhar Khan
Starting Member
3 Posts |
Posted - 2012-02-24 : 05:06:39
|
| create table [dbo].[TEST]([idno][nvarchar](50) NULL,[date]date NULL,[particulare][nvarchar](50) NULL,)on [PRIMARY];insert into TEST values(1,'01/12/2012','A');insert into TEST values(2,'01/13/2012','B');insert into TEST values(3,'01/14/2012','C');select top 1 date,idno from TEST order by date desc;just run this SQL's in your database and get result:-Date idno1/14/2012 3Azhar khan |
 |
|
|
|
|
|
|
|