Link to home
Start Free TrialLog in
Avatar of Aleks
AleksFlag for United States of America

asked on

Query to reorder digits of string

I have a nvarchar field with 13 digits. all numbers like:

1234567654321

I need to run a query that will reorganize the order of this digits.

I need the 11th digit to me moved to number 13
I need the 12th digit to me moved to number 11
I need the 13th digit to me moved to number 12

How can this be done ?   Following such example the above number would end up being:

From: 1234567654321
To: 1234567654213

Thanks

Aleks
SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg 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
SOLUTION
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
ASKER CERTIFIED SOLUTION
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