Link to home
Start Free TrialLog in
Avatar of doramail05
doramail05Flag for Malaysia

asked on

Sort nvarchar in SQL Server 2005

in SQL Server 2005, how do we sort this nvarchar field

SO204750000000011
SO50340000000001
SO53000000000002
SO68190000000003

so it will become

SO50340000000001
SO53000000000002
SO68190000000003
SO204750000000011
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
order by cast(right(fieldname, 3) as int) asc