Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine week by Month and Month Week
Message
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Determine week by Month and Month Week
Miscellaneous
Thread ID:
01653958
Message ID:
01653958
Views:
69
Hi,

I found (online) the following code that determines the month number by Week and Year.
declare @Year char(4), @Week tinyint
select @Year = '2003', @Week = 10
select month(dateadd(wk,@Week,@Year + '/01/01'))
How would I use the above expression or is there another expression that will give me the Week Number (in a year, 1-52) if the Month Number (e.g. 1 to 12) is known and the Week Number in the month (1-5)?

TIA
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Next
Reply
Map
View

Click here to load this message in the networking platform