• lmu92 (3/15/2010)


    Something like this?

    DECLARE @OutlineNumber VARCHAR(1000)

    SET @OutlineNumber= '.I.A.1.b.'

    SELECT STUFF(SUBSTRING(@OutlineNumber,1,CHARINDEX('.',@OutlineNumber,N+1)),1,1,'')

    FROM dbo.Tally

    WHERE N < LEN(@OutlineNumber)

    AND SUBSTRING(@OutlineNumber,N,1) = '.'

    The variable needs to have a dot at the beginning and at the then for this solution to work...

    This is exactly what I was looking for!

    Thank you all for your help.