List sorting - Order by

Status
Not open for further replies.

jo-ka

Member
Hello,

I have a list where I have an alphanumeric filed (text) which is filled with majorly numbers but also can have letters.

I need to order this list by this field but, as expected, the settings I've set give me the traditional MySQL sorting for a varchar field type. Is there a way to overcome this?

I've read about a natsort() function in PHP... Is there anyway to implement this?

View attachment 17310

The result...

View attachment 17309

Is there a way to apply
 
something like this would work too...

SELECT names FROM your_table ORDERBY games +0 ASC
 
We handle ordering in the query, so PHP won't help.

Add adding the +0 trick wouldn't be trivial, as I'd have to add that as an option on the order by settings - some people will rely on the current ordering behavior. So I'd have to add an option to "treat text as numeric", and default it to No. And adding any kind of option to the ordering is not trivial, as there are four different ways of ordering (the main List ordering, group ordering, query string ordering, and list header ordering), all of which would need to then implement that extra option (or at least default them, even if we don't provide the new option for all ways of ordering).

So the answer is ... yes, it would be possible, but not something I can do as part of subscription support. It would have to be funded work.

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top