SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Remove value from middle of string
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mxfrail
Yak Posting Veteran

84 Posts

Posted - 12/08/2012 :  07:24:25  Show Profile  Reply with Quote
Hi,

Could I get help with the following so I can avoid creating multiple concat with left and right to do the following -

To perform successful join I need remove a value from the middle of my production file.

Product_Code
634020030410 – Load file
63402030410 - Production

I wanted to avoid -

left(product_code,6)
right(product_code,5)

To make -

concat(left(product_code,6),right(product_code,5))

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 12/08/2012 :  08:27:25  Show Profile  Reply with Quote
Perhaps this?
STUFF(product_code,7,LEN(product_code)-11,'')
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22742 Posts

Posted - 12/24/2012 :  06:47:01  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
What is middle string? It may vary based on data length

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000