Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2003
    Posts
    6

    Question Unanswered: SQL - Get month from week number

    Hi anybody knows of a function to get the month given the week no and the year as input parameters? Any help would be much appreciated

  2. #2
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    Not exactly a function, but it could be converted to one...

    Code:
    declare @Year char(4), @Week tinyint
    select @Year = '2003', @Week = 10
    select month(dateadd(wk,@Week,@Year + '/01/01'))
    Paul Young
    (Knowledge is power! Get some!)

  3. #3
    Join Date
    Jun 2003
    Posts
    6

    Wink

    Hi Paul,

    The code works! Thanks so much for the help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •