Here is how you do it from the format of the data you have provided
Look for the First _ character from the left of the string. This is the
position at which you start
Look for the first _ character from the right of your string and add two
places. This is there you end.
Use substring to grab the String i.e.
2004_03_11
Now use Replace to replace the _ with ''
--
Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com
"Steve" <Steve (AT) discussions (DOT) microsoft.com> wrote
Quote:
Hi
I have column FName of varchar type.
FName
------
Mktg_2004_03_11Completed
Fin_2004_03_10Test
Acct_2004_03_09Failed
I want to get get result set as
FName
------
20040311
20040310
20040309
I tried using replace, stuff but couldn't make it work.
Plz. help
Thanks |