On Mon, Feb 15, 2010 at 9:58 PM, Bob Miller <..hidden..> wrote:
There was some chat a while ago with regards to sorting by description,
and the two suggestions were to sort the query in the sql statement
before producing the html page, and the other was to use javascripting
to do the same. My question is about numbers, though, not letters.
For my installations, when sorting by invoice number, my numbers go like
this:
1
10
100
101
102
103
104
105
106
107
108
109
11
110
111
and so on. Is there a way to make it so invoices 11-99 comes *before*
100??
If all invoice numbers include only numbers instead of letters, you
could alter the SQL query to order by the invoice number converted to
a numeric datatype. The problem though is that invoice numbers can
include letters, so consequently they are sorted in the db as text
strings. Otherwise an invoice like 110-V would cause such a query to
error.