Re: SQL issue?
From: Allan Mitchell (allan_at_no-spam.sqldts.com)
Date: 11/11/04
- Next message: GaryC: "Importing text files from Unix"
- Previous message: Allan Mitchell: "Re: Multiple Query Advice"
- In reply to: Steve: "SQL issue?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 11 Nov 2004 20:23:15 -0000
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@discussions.microsoft.com> wrote in message news:6EC01CE9-6FAE-4DC7-BC7F-EDAA959BAB69@microsoft.com... > 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
- Next message: GaryC: "Importing text files from Unix"
- Previous message: Allan Mitchell: "Re: Multiple Query Advice"
- In reply to: Steve: "SQL issue?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|