• 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 statement

    CHAR(44) is the ASCII comma.

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]