SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Day-of-week to Week-Number mapping


Day-of-week to Week-Number mapping

Author
Message
Sergiy
Sergiy
SSC Guru
SSC Guru (98K reputation)SSC Guru (98K reputation)SSC Guru (98K reputation)SSC Guru (98K reputation)SSC Guru (98K reputation)SSC Guru (98K reputation)SSC Guru (98K reputation)SSC Guru (98K reputation)

Group: General Forum Members
Points: 98736 Visits: 14262
Hi,
Here is the problem I'm not sure how to resolve.
May be somebody faced something similar and can give me an idea where to start.

I've got a new set of socks which are marked with week day names: "Monday", "Tuesday", etc.
My best guess is that it must indicate on which week I should wear which pair of socks.
But I'm not sure how do I convert the week days into week numbers(?).

Does anybody know what is the rule to apply here?
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (872K reputation)SSC Guru (872K reputation)SSC Guru (872K reputation)SSC Guru (872K reputation)SSC Guru (872K reputation)SSC Guru (872K reputation)SSC Guru (872K reputation)SSC Guru (872K reputation)

Group: General Forum Members
Points: 872685 Visits: 47485
Cross Join with a list of weeks? Don't forget to compensate for laundry day offsets. Wink

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Jeff Atherton
Jeff Atherton
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2549 Visits: 545
Move to FL and just wear flip flops... problem solved. Hehe
ChrisM@Work
ChrisM@Work
SSC Guru
SSC Guru (165K reputation)SSC Guru (165K reputation)SSC Guru (165K reputation)SSC Guru (165K reputation)SSC Guru (165K reputation)SSC Guru (165K reputation)SSC Guru (165K reputation)SSC Guru (165K reputation)

Group: General Forum Members
Points: 165592 Visits: 21619
Sergiy - Wednesday, March 15, 2017 10:42 PM
Hi,
Here is the problem I'm not sure how to resolve.
May be somebody faced something similar and can give me an idea where to start.

I've got a new set of socks which are marked with week day names: "Monday", "Tuesday", etc.
My best guess is that it must indicate on which week I should wear which pair of socks.
But I'm not sure how do I convert the week days into week numbers(?).

Does anybody know what is the rule to apply here?


Please provide detailed instructions for creating and setting up your loom. What colour is your cotton?

“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
Sergiy
Sergiy
SSC Guru
SSC Guru (98K reputation)SSC Guru (98K reputation)SSC Guru (98K reputation)SSC Guru (98K reputation)SSC Guru (98K reputation)SSC Guru (98K reputation)SSC Guru (98K reputation)SSC Guru (98K reputation)

Group: General Forum Members
Points: 98736 Visits: 14262
Jeff Atherton - Thursday, March 16, 2017 7:25 AM
Move to FL and just wear flip flops... problem solved. Hehe

that's what we usually do here in NZ, no need to move anywhere.
But what to do with those stupid socks?
I must figure out the pattern!

ChrisM@Work
ChrisM@Work
SSC Guru
SSC Guru (165K reputation)SSC Guru (165K reputation)SSC Guru (165K reputation)SSC Guru (165K reputation)SSC Guru (165K reputation)SSC Guru (165K reputation)SSC Guru (165K reputation)SSC Guru (165K reputation)

Group: General Forum Members
Points: 165592 Visits: 21619
Sergiy - Monday, June 12, 2017 8:06 AM
Jeff Atherton - Thursday, March 16, 2017 7:25 AM
Move to FL and just wear flip flops... problem solved. Hehe

that's what we usually do here in NZ, no need to move anywhere.
But what to do with those stupid socks?
I must figure out the pattern!


Fill with sand (or any old sh1t you can find), paint on a happy face and voila! Politician :-)

“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
robert.sterbal 56890
robert.sterbal 56890
SSCrazy Eights
SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)

Group: General Forum Members
Points: 9040 Visits: 1661
Just buy socks from one day of the week.
Luis Cazares
Luis Cazares
SSC Guru
SSC Guru (162K reputation)SSC Guru (162K reputation)SSC Guru (162K reputation)SSC Guru (162K reputation)SSC Guru (162K reputation)SSC Guru (162K reputation)SSC Guru (162K reputation)SSC Guru (162K reputation)

Group: General Forum Members
Points: 162543 Visits: 22753
Sergiy - Monday, June 12, 2017 8:06 AM
Jeff Atherton - Thursday, March 16, 2017 7:25 AM
Move to FL and just wear flip flops... problem solved. Hehe

that's what we usually do here in NZ, no need to move anywhere.
But what to do with those stupid socks?
I must figure out the pattern!

Sock puppets!



Luis C.
General Disclaimer:
Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?


How to post data/code on a forum to get the best help: Option 1 / Option 2
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search