[thelist] [SQL] Sorting numerical and text data

Howard Cheng thelist at lists.evolt.org
Thu Apr 11 17:03:00 2002


Evolters,

I have a conundrum wherein I have one VARCHAR column that contains both
numerical and text data. I want to be able to sort my result set with that
column, but the numbers have be treated as numbers, not as text.

I other words, if I have a result set with the values 4, 28, 100, and
'variable' (this field indicates luggage capacity of an airplane), the
results  should sort in that order, but because it's a VARCHAR field it
becomes 100, 28, 4, 'variable'.

Any ideas? Thanks.

::::::::::::::::::::::
Howard Cheng
howcheng@ix.netcom.com
AIM: bennyphoebe
ICQ: 47319315