shashi kant
SSCommitted
Points: 1659
More actions
February 2, 2007 at 1:43 am
#116190
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
David Burrows
SSC Guru
Points: 65142
February 2, 2007 at 2:28 am
#687332
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.
February 2, 2007 at 2:47 am
#687337
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