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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 SQL Query Issue
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ravininave
Posting Yak Master

India
111 Posts

Posted - 12/12/2012 :  03:32:32  Show Profile  Reply with Quote
My Table: BoardMast
Structure
AppMstID int
tCount int
lDate Datetime
SrNo int

INSERT INTO BoardMast (1,1,'2012-12-12 13:19:04.873',3)
INSERT INTO BoardMast (2,2,'2012-12-12 13:20:08.407',7)
INSERT INTO BoardMast (3,2,'2012-12-12 13:21:07.647',5)
INSERT INTO BoardMast (4,0,'2012-12-12 13:22:08.257',NULL)
INSERT INTO BoardMast (5,0,'2012-12-12 13:23:23.853',NULL)
INSERT INTO BoardMast (6,0,'2012-12-12 13:25:18.887',NULL)
INSERT INTO BoardMast (7,0,'2012-12-12 13:29:38.743',NULL)

I wish to order on tCount Desc, lDate Desc
for that I wrote:

Select * from BoardMast order by tCount desc ,lDate desc;
it returns
3
2
1
7
6
5
4

first 3 are correct but another 4 are not in order of date
it should
4
5
6
7
Can anyone correct the query.



VB6/ASP.NET
------------------------
http://www.nehasoftec.com

bandi
Flowing Fount of Yak Knowledge

India
2241 Posts

Posted - 12/12/2012 :  03:53:58  Show Profile  Reply with Quote
Select * from BoardMast order by tCount desc ,lDate desc;


--
Chandu
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000