Sort by number

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sab0tajue
    Senior Member
    • Jul 2019
    • 315

    Sort by number

    Please tell me how to make a normal sorting by field "#" type Number. If I click on the field heading in the table, then they line up: 1, 10, 11, 12 .... 2, 20, 21, 22 ..... 3, 30, 31 ...
    I need to do a sort of 1, 2, 3 .... 9, 10, 11 ..... 19,20 ... in a row.

    I don’t understand how to do it. Played with different settings. Thank you in advance for your help
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1606

    #2
    Hi, leading zeros would help. And then the field has to be a text field. Because a real number does not have zeros in front. But maybe, that is not what you would want.
    Numbers in terms of database are always sorted that way.

    I use the "rule": when you won`t calculate with it, make it a text string, not a number.
    Last edited by shalmaxb; 06-04-2021, 05:32 PM.

    Comment

    • Sab0tajue
      Senior Member
      • Jul 2019
      • 315

      #3
      Thank Q

      Comment

      • esforim
        Active Community Member
        • Jan 2020
        • 2204

        #4
        It quite annoying yes, I believe the term for these sorting is Logical and Natural.

        Logicical: 1, 10, 11, 12, 2, 20, 21
        Natural: 1 2 3... 10, 11, 12...

        I can't seem to find any article on this topic though. But there is a Wiki page for natural order: https://en.wikipedia.org/wiki/Natural_sort_order

        Comment

        Working...