on 10-10-2008 3:27 PM
Hi,
I have a query on sales orders and I use the order by function to sort. I want it to sort some columns decending and other columns ascending. Is there a way to do this?
Thanks!
Emily,
Seeing your query would give a better idea of what you are looking for. If possible paste the same here and then mentioned the columns and your requirement.
Suda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Emily,
When you sort your query in combination, better to put all restriction on your sorting fields. For descending, add DESC. For ascending, add ASC. You can always omit the later since it is default. Putting it there can help you to be more clear.
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi here is a sample for descending sorting :
SELECT TOP 1 T0.TrsfrRef FROM ORCT T0 ORDER BY T0.TransID DESC
ascending sort is default in SQL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
11 | |
10 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.