how to retrieve the week number for a given date

  • sql query

    how to retrieve the week number for a given date

    suppose today's date 02-02-2007,i need to get the value of week 1 (not week 5 of the year).

    i want sql code.

    please send me as early as possible.

    thanking you

  • Do you mean

    DATEPART(week,[date]) - DATEPART(week,DATEADD(month,DATEDIFF(month,0,[date]),0)) + 1

    or is there something special about the 'week' number you want.

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

  • thanx David Burrows

    i got the same result which I needed....

     

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

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