Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Masking

Author  Topic 

junior6202
Starting Member

45 Posts

Posted - 2014-07-29 : 16:32:16
Hello All,

I have a question If I were to have a column named ItemNumber with data that looked like this "CC12345" and I wanted to fill another Column called CustNumber with the same data but the end result would look like this "CC1C23C45" what function or what should i try doing. CC+1+C+23+C+45 any help will be appreciated.


Thank you,

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2014-07-29 : 16:44:15
SELECT STUFF(STUFF(Col1, 4, 0, 'C'), 7, 0, 'C')



Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA
Go to Top of Page

junior6202
Starting Member

45 Posts

Posted - 2014-07-30 : 12:23:23
Thank you very much, it worked perfectly.
Go to Top of Page
   

- Advertisement -