Help

  • Hi,

    I need help.

    I try to write a function as below.

    But i doesn't return anything.

    What's the wrong?

    thank you very much for helps.

    ******************************************************

    Create FUNCTION months()

    RETURNS @ay TABLE (ad nvarchar(100),deger int,yil int)

    AS

    BEGIN

    declare @sayi int

    set @sayi=1

    while @sayi>12

    begin

    INSERT INTO @ay

    select dbo.GetMonthName(@sayi),@sayi,Year(GetDate())

    set @sayi=@sayi+1

    end

    RETURN

    END

    ***************************************************************

  • Your loop is wrong, you set the variable to be one - Then you say 'While variable is GREATER THAN twelve'! :hehe:

    Also, I assume your dbo.GetMonthName function is OK?

    Best wishes - Leo

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply