Knowledgebase

Home » Item #466

Changing the order of sorting

Item: #466
Date: 19 Apr 2003
Applies to
v4

Question

I would like to display the version sorted by price in DESCENDING order (largest to smallest). How is that accomplished?

Answer

The basic instructions for controlling ordering are dealt with here:

www.cactushop.com/support/viewitem.asp?recor=0&ID=328

To get items ordered by descending order, add "DESC" to the end of the "order by" statement, for example:

ORDER BY V_Price DESC

This works for fields that are numeric, alphabetical or dates. To order in ascending order, the code is:

ORDER BY V_Price ASC

...however, since this is the default direction, it is more normally written as just:

ORDER BY V_Price

Can't find the answer you need? Click here to open a support ticket.

« Back