![]() | |
![]() |
| | Thread Tools | Display Modes |
#41
| |||
| |||
|
|
That's harder. All I can think of is to write a function which finds the first non-numeric character position. Sort by the numeric value of the digits, and then by the remaining alpha portion. eric.lecocq (AT) toto (DOT) com> wrote in message news:OFB$a9OXIHA.1184 (AT) TK2MSFTNGP04 (DOT) phx.gbl... problem is that a bus line can contain character eg. line "108" and "108A" and this must be sorted as 108 and then 108S 1 1A 2 34 3B 3BC 4 "Paul Shapiro" <paul (AT) hideme (DOT) broadwayData.com> a écrit dans le message de groupe de discussion : #Ou5e3OXIHA.2000 (AT) TK2MSFTNGP05 (DOT) phx.gbl... Use Order By Cast(columnName as int), as long as all values are legitimate integers. But if so, why not make the column datatype int? eric.lecocq (AT) toto (DOT) com> wrote in message news:521B05F4-CB45-4503-A3F9-BB821E27A67A (AT) microsoft (DOT) com... Hello Everybody, my question is the following. how can sort numerically a sql query with varchar field ? |
![]() |
| Thread Tools | |
| Display Modes | |
| |