ShopPilot > SSP - Shop Server Pages
Zahlen in Textfeld richtig sortieren
(1/1)
dobra:
Wenn man Zahlen in ben.def Feldern mit "ORDER BY" sortieren will, hat man das Problem dass 11 kleiner als 9 ist :(
1
226
3
4
56
673
7
usw
Abhilfe:
statt
ORDER BY <Textfeld> ASC/DESC
schreibt man
ORDER BY CONVERT (<Textfeld>, DECIMAL) ASC/DESC
so werden dann Zahlen auch in Textfeldern korrekt sortiert
im Beispiel:
1
3
4
7
56
226
673
Linkback: https://www.shoppilot.net/pf/index.php?topic=1741.0
Navigation
[0] Themen-Index
Go to full version