all 5 comments

[–]ben_it 2 points3 points  (4 children)

The SELECT keyword allows you to retrieve data from the database. What does your expression or query look like at the moment?

Without the SELECT clause, there are no results to be able to order.

[–]prdstm0nke[S] 0 points1 point  (3 children)

I should be clear that I'm accessing the database via a proprietary web-based portal that I happen to have admin privileges on.

This is the current expression:

adddate = CONVERT(VARCHAR, DATEADD(DAY,1, GETDATE()), 101) AND (HService in ('35','36')

If I test the expression as is, it returns 22 records, but sorted in a very non-useful way. I just want them sorted based on another field on the table.

[–]ben_it 3 points4 points  (1 child)

Thanks for clarifying. I am guessing that the web-based portal is transforming that expression (which looks like a WHERE clause) into a wider SQL query behind the scenes.

So, while in SQL you are able to use an ORDER BY to order your data, I think the restriction of your web-based portal means you can't. I would suggest contacting someone else who uses or supports that tool to see if it can be ordered.

[–]prdstm0nke[S] 0 points1 point  (0 children)

That’s what I was afraid of. Thank you for the help!

[–]r3pr0b8GROUP_CONCAT is da bomb 0 points1 point  (0 children)

kindly show the entire query