Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL error on order by

Status
Not open for further replies.

jgurgen

Programmer
Mar 9, 2006
192
US
ORDER BY
Comments.LoanID ASC,
Comments.DateandTime ASC


Server: Msg 1033, Level 15, State 1, Procedure R_reminders_ifs, Line 17
The ORDER BY clause is invalid in views, inline functions, derived tables, and subqueries, unless TOP is also specified.


What is wrong with this Query?
 
Perhaps the error message is telling the truth?
 
it probably is but thats what was genertaed by crystal reports
 
Did you check into the SQL statement or stored procedure that crystal is trying to use?
 
jgurgen,

Sheco can't answer your question because you're only showing us one line of the code. You'll have to post the entire segment for us to be able to answer the question.

If this Order By statement is inclosed in a sub-query, or the Select clause of an Insert Statement, or even an Update statement, then you need remove that one line and you shouldn't have any problem. However, without seeing all the code involved, no one is going to be able to help you out.

Sorry.



Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top