Selectis


I have a field (varchar) in a list that contains numbers and letters. I want to sort this table but I have only two functions that will work to convert the values:

Val
The Val function sorts the numbers in the string, but the letters are not sorted

CStr
The CStr function sorts the letters, but the numbers are not sorted

How can I sort the numbers and letters




Re: Sorting a table with numbers and letters

Andrew - T4G


Is the table structured like this

1
a
2
b

or like this

1a1
2b2
c3c

If it's the first case you should be able to sort the table by creating two queries, selecting just the letters and just the numbers and then unioning the two queries together, or possibly using a case statement in the order by clause of the query.

For the list itself you can try a similar fix using two lists, showing just the letters in the first list & just the numbers in the 2nd list, and then sorting by just letters & just numbers.

Hope this helps.

Andrew







Re: Sorting a table with numbers and letters

Selectis

The table is structured like this:

10
ABC
1002
50
BCD

How can I select only the numbers






Re: Sorting a table with numbers and letters

Selectis

I have renamed the numbers in the table (10 -> 0010) so all the numbers have 4 characters. Because I only need the numbers I have set a filter "BETWEEN 0 AND A". The sorting is no problem anymore.