doramail05
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
SO204750000000011
SO50340000000001
SO53000000000002
SO68190000000003
so it will become
SO50340000000001
SO53000000000002
SO68190000000003
SO204750000000011
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
order by cast(right(fieldname, 3) as int) asc