[RESOLVED] Natural sort order in SQL Access query.
How can i sort a column (APART=CHAR field) in an access table in natural sort order with this value:
1
10
12
PART
14
2
3+4
5
6
8
9-10
I want sort in this order:
1
2
3+4
5
6
8
9-10
12
14
PART
I use "SELECT * FROM db ORDER BY APART+0" ... But not work...
Please help.
Thank you
Re: Natural sort order in SQL Access query.
There isn't an easy way to do it, but you can get closer to what you want by using this:
Code:
"SELECT * FROM db ORDER BY Val(APART), APART"
That will list the text-only ones first... the following might switch them to the end:
Code:
"SELECT * FROM db ORDER BY Val(APART)>0, Val(APART), APART"
Re: Natural sort order in SQL Access query.