First Day of Week

  • Does any one know, how can I get the first day of some week. For instance, I want to know the first day of week "20" in year 2001.

    Any help I appreciate.

    WolfJr

  • Look in BOL under the DATEADD Function.

    Something like this

    select dateadd(wk, 20, getdate()) 


    -JG

  • SELECT DATEADD(d,-DATEPART(dw,DATEADD(wk,20,'1/1/' + CAST(YEAR(GETDATE()) AS CHAR(4)))) + 1,DATEADD(wk,20,'1/1/' + CAST(YEAR(GETDATE()) AS CHAR(4))))

    However 20 gives you week 21 not 20. Whatever number you enter is week # (your number + 1)

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

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