Jump to content


Recommended Posts

I am new to this forum and very new to this SQL issue.
As you know Excel allows you to sort a set of data in ascending or descending order and through an ordered list.
And here begins my problem, ie I would like to know if it is possible to do this order through a SQL statement.
Sort ascendingly and descending I already know how to do but what I wanted, and it is shown in the example I attached, it was first to sort by field F58 in ascending order and then to sort by field F66 by the following list 'RR-CON, RR-COGP, RR -COCN, RR-COCS, RR-COGL, RR-COS '
I've got an example, with the VBA code that fetches me a table from the F58 and F66 values according to certain criteria, and then that data is only sorted by field F58, I'd like it to be sorted from the list above.
It's possible?
Many thanks
Jorge Cabral

Teste com SQL_V1 - ENG.xlsm

Link to comment
Share on other sites

  • 4 weeks later...

In conjunction with what justsomeguy said,

You'll be able to put the query into practice after you've enumerated your custom column with something like this

ORDER BY `products`.`product_category_id` DESC ,`naam` ASC

In case you wanted to alternate, I'm sure you could modify this to suit your needs.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...