Forum Replies Created

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

  • RE: getting week number of the current year

    HI Try this procedure

    CREATE PROCEDURE PROC_GETWEEKNUMBERS

    @strtdate datetime,

    @enddate datetime

    AS

    DECLARE @cnt int

    DECLARE @i int

    SET @i=0

    SELECT @cnt= datediff(ww,@strtdate,@enddate)

    DECLARE @WeekNumbers Table(weeknumber int)

    DECLARE @wknum int

    SELECT @wknum=Datepart(Wk,@strtdate)

    SELECT @strtdate=Dateadd(dd,1,@strtdate)

    WHILE(@i < @CNT)

    BEGIN

    Insert into @WeekNumbers(weeknumber)...

  • RE: ORDER BY

    for sql 2005 also it works

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