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
 General SQL Server Forums
 New to SQL Server Programming
 multiple ORDER BY

Author  Topic 

ArthurKay
Starting Member

7 Posts

Posted - 2007-05-15 : 10:50:37
I am pretty new to SQL coding, but I assume this can be done and I just don't know the syntax.

I have an application which pulls my data using "... ORDER BY #date#"

Can I have it do something like "... ORDER BY #date# AND name" so that it sorts things first by date, and then by name?

Thanks in advance!

nr
SQLTeam MVY

12543 Posts

Posted - 2007-05-15 : 10:59:02
order by [date], name

the default is ascending, you can also
order by [date] desc, name asc



==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-05-15 : 11:06:21
Also, Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -