Help Needed with Sorting

Help Needed with Sorting

fxhfxh Posts: 3Questions: 0Answers: 0
edited July 2012 in General
I have a table column with the following data:

~ D
C
A
~ F
~ B
E


I'd like to sort it as:

A
C
E
~ B
~ D
~ F

But It gets sorted as

A
~ B
C
~ D
E
~ F

Any help would be appreciated

Replies

  • fxhfxh Posts: 3Questions: 0Answers: 0
    edited July 2012
    http://live.datatables.net/ocezan/2/edit#javascript,html
  • allanallan Posts: 63,540Questions: 1Answers: 10,476 Site admin
    What browser sorts your example incorrectly? I've just tried Firefox and Chrome and they sort it as:

    [quote]
    A
    C
    E
    ~ B
    ~ D
    ~ F
    [/quote]

    Allan
  • fxhfxh Posts: 3Questions: 0Answers: 0
    OK, solved:

    I was using server-side processing, with a postgresql database. Issue was that my database locale was set to US. Workaround is to specify "COLLATE" for the relevant field

    i.e SELECT * FROM MYTABLE ORDER BY MYFIELD COLLATE "C" ASC

    Thanks
This discussion has been closed.