I have a View that uses fields from the Biblio module and those are unfortunately all defined as text fields. I need to sort my view according to the accession number, but if define the sorting in the View it sorts the numbers wrong like
1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20 ...
instead of
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ...
I assume this is because Views interprets those as string and sorts them accordingly.
Is there an easy way to create a custom sort function that would sort those as numbers? Or maybe I could override the autogenerated SQL (I know how to do that), but I don't know how to sort strings as numbers in SQL.