?
Solved

Using SQL Server 2005, is it possible to use a concatenation of fields in an ORDER BY clause where one of the fields has DESC sequence?

Posted on 2012-09-06
1
Medium Priority
?
341 Views
Last Modified: 2012-09-06
Using SQL Server 2005, is it possible to use a concatenation of fields in an ORDER BY clause where one of the fields has DESC sequence?

For example:

order by (DollarTitle + MthTitle)     <---  This works fine

order by DollarTitle Desc,               <---  This works fine

Then I tried:

order by (DollarTitle Desc + MthTitle)      <--- This generates the following error:

Incorrect syntax near the keyword 'Desc'
0
Comment
Question by:zimmer9
1 Comment
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 2000 total points
ID: 38373226
order by DollarTitle Desc ,MthTitle DESC
or

order by DollarTitle Desc ,MthTitle ASC
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Screencast - Getting to Know the Pipeline

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question