Convert week number to date range

  • Is it possible to change a week number to a date range???

    ie week 5 to 27/01/03 and 2/2/03

    Thanks

    Scott

  • Not pretty but give you what u want

    declare @d datetime

    declare @w int

    set @d = '2003-01-01'

    set @w = 5

    set datefirst 1

    set @d = @d-(datepart(dw,@d)-1)

    select @d+((@w -1) * 7),(@d+((@w -1) * 7))+6

    Far away is close at hand in the images of elsewhere.
    Anon.

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

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