﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / T-SQL (SS2K5)  / Remove Characters from String / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 18 Jun 2013 00:27:41 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Remove Characters from String</title><link>http://www.sqlservercentral.com/Forums/Topic565829-338-1.aspx</link><description>Thank you, that worked!</description><pubDate>Tue, 09 Sep 2008 10:36:38 GMT</pubDate><dc:creator>Jody Claggett-376930</dc:creator></item><item><title>RE: Remove Characters from String</title><link>http://www.sqlservercentral.com/Forums/Topic565829-338-1.aspx</link><description>To select just the month, that is data to the left of the first comma try this code to give you an idea of what you can do:DECLARE @FM as VARCHAR(10)DECLARE @Indata AS VARCHAR(20)SET @Indata = 'July, 2008'SET @FM = (SELECT(SUBSTRING(@Indata,1,(CHARINDEX(CHAR(44), @indata)-1))))PRINT 'For testing fiscal month is*' + @FM + '*'at this point the variable @FM contains what you want and you can then insert this into a column in a table, use the set statement in a function or use it as you wish.I included:PRINT 'For testing fiscal month is*' + @FM + '*'so that you can verify your results before using, of course in actual use you will not include the PRINT statementCHAR(44) is the ASCII comma.</description><pubDate>Mon, 08 Sep 2008 19:01:44 GMT</pubDate><dc:creator>bitbucket-25253</dc:creator></item><item><title>Remove Characters from String</title><link>http://www.sqlservercentral.com/Forums/Topic565829-338-1.aspx</link><description>I have a set of data that gives me month name and year in this format:FiscalMonthJuly, 2008August, 2008September, 2008I need to select only the month name part of the string, so everything from the comma to the right needs to be excluded. I tried searching for a forum subject on this, but couldn't find anything. If there is another post with information on this, please let me know.Thank you.</description><pubDate>Mon, 08 Sep 2008 16:34:38 GMT</pubDate><dc:creator>Jody Claggett-376930</dc:creator></item></channel></rss>