Captain D
The code worked like a charm.
Update tblDemoTest set AcctNo = LEFT(AcctNo, 1)+ '' + Cast(Cast(right (AcctNo,LEN(Acc tNo)-1)as BigInt)*2 as char(15)) + ''
from tblDemoTest
Thanks a million..
User Profile
Collapse
-
CaptainD,
Thanks for the reply.
It worked but I need to modify it a bit.
The table has a few hundred rows so
1. I need to feed the values in. (Can I substitute a select clause for A12345 in the code)
2. I need to update the field in the same column and table
My logic was,
1. scroll through the column,
2. decide if the first digit is a character,
if so take it off,
...Leave a comment:
-
CaptainD,
Thanks for the reply.
It worked but I need to modify it a bit.
The table has a few hundred rows so
1. I need to feed the values in. (Can I substitute a select clause for A12345 in the code)
2. I need to update the field in the same table
My logic was,
1. scroll through the column,
2. decide if the first digit is a character,
if so take it off, multiply the digit section...Leave a comment:
-
Data Manipulation
Hello,
I'm trying to change some data in database and I'm having some problems.
Scenario: Table A has a columnA with some data A123, B456, C789, 12345.
ColumnA
A123
B456
C789
12345
I'm trying to multiply the digits in the column by 2, leaving the letters as is.
The code I'm using is:
UPDATE Table A
SET
CoulmnA= Replace(CoulmnA ,Left(CoulmnA,1 ),'... -
Data Manipulation
I'm trying to change some data in database and I'm having some problems.
Scenario: Table A has a columnA with some data A123, B456, C789, 12345.
ColumnA
A123
B456
C789
12345
I'm trying to multiply the digits in the column by 2, leaving the letters as is.
The code I'm using is:
UPDATE Table A
SET
CoulmnA= Replace(CoulmnA ,Left(CoulmnA,1 ),' ')...
No activity results to display
Show More
Leave a comment: