• Here is another method .... not efficient .... not recommended ... but it does what you seem to need to do.

    DECLARE @BegYr INT = 2013

    DECLARE @EndYr INT = 2015

    DECLARE @E INT

    DECLARE @a VARCHAR(10)

    DECLARE @Z VARCHAR(10)

    SET @E = @BegYr

    SET @Z = (SELECT SUBSTRING(CAST(@E AS VARCHAR(4)),LEN(CAST(@E AS VARCHAR(4))),LEN(CAST(@E AS VARCHAR(4)))))

    WHILE @E < @EndYr

    BEGIN

    SET @E = @E + 1

    SET @a = (SELECT '/' + SUBSTRING(CAST(@E AS VARCHAR(4)),LEN(CAST(@E AS VARCHAR(4))),LEN(CAST(@E AS VARCHAR(4)))))

    SET @Z = @Z + @a

    END

    SELECT @Z

    Result:

    3/4/5

    If you would/could explain why you have this requirement, some may be able to assist you with a more efficient solution.

    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]