dtml-in sort_expr and expression
Dear all, I have problem with sorting by values. I have numbers in database in textual form. I need something like <dtml-in database sort=a,b> this sorting is bad becaouse a and b are strings, not numbers. But following examples <dtml-in database sort_expr="int(a),int(b)"> <dtml-in database sort_expr="_str(a).int(),_str(b).int()"> returns errors for all what I was try. Many thanks for help, -- Jaroslav Lukeš -- Tento e-mail nemůže obsahovat VIRY jelikož nepocházi z virózního systému M$ Windows!
Jaroslav Lukesh wrote:
Dear all,
I have problem with sorting by values. I have numbers in database in textual form.
Resolved, database column is converted to number format :-) -- Jaroslav Lukeš -- Tento e-mail nemůže obsahovat VIRY jelikož nepocházi z virózního systému M$ Windows!
Jaroslav Lukesh wrote at 2004-4-2 16:28 +0200:
... this sorting is bad becaouse a and b are strings, not numbers. But following examples
<dtml-in database sort_expr="int(a),int(b)"> <dtml-in database sort_expr="_str(a).int(),_str(b).int()">
returns errors for all what I was try.
Use "sequence.sort" and provide your own sort function. -- Dieter
participants (2)
-
Dieter Maurer -
Jaroslav Lukesh