Function for Getting Interval Dates by days,months,years.

  • Comments posted to this topic are about the item Function for Getting Interval Dates by days,months,years.

  • Quite elaborate, thanks.

  • Failed on line 374.

  • Msg 213, Level 16, State 1, Procedure FunGetIntervalDates, Line 373

    Column name or number of supplied values does not match table definition.

  • can you please tell me the passing values on function for which you are getting issues.

  • I did not run it, I was just compiling it when this error came up. It had to do with not having the same number of arguments in an insert.

  • dlchase (12/11/2015)


    I did not run it, I was just compiling it when this error came up. It had to do with not having the same number of arguments in an insert.

    Thanks for the insight.

  • Change the Last Else part with given below script.

    ELSE

    BEGIN

    INSERT @Table

    SELECT @EntityId AS Value,

    Rank()

    OVER(

    ORDER BY RecuringDATE) AS id,

    Rank() OVER (

    partition BY Datename(MM, RecuringDATE), Datename(yyyy, RecuringDATE), Datename(dw, RecuringDATE)

    ORDER BY RecuringDATE) AS Label,

    RecuringDATE,

    Datename(MM, RecuringDATE) AS DayName,

    Datename(dw, RecuringDATE) AS WeekName,

    ((SELECT Datepart(WEEK, RecuringDATE) - Datepart(WEEK, Dateadd(MM, Datediff(MM, 0, RecuringDATE), 0)) + 1)) AS Weeks,

    Datename(yyyy, RecuringDATE) AS year

    FROM @tempDATE

    ORDER BY RecuringDate

    END

    RETURN;

Viewing 8 posts - 1 through 7 (of 7 total)

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