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 (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)

Group: General Forum Members
Points: 96201 Visits: 13906
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 (845K reputation)SSC Guru (845K reputation)SSC Guru (845K reputation)SSC Guru (845K reputation)SSC Guru (845K reputation)SSC Guru (845K reputation)SSC Guru (845K reputation)SSC Guru (845K reputation)

Group: General Forum Members
Points: 845909 Visits: 46642
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: 2523 Visits: 543
Move to FL and just wear flip flops... problem solved. Hehe
ChrisM@Work
ChrisM@Work
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: 162311 Visits: 21422
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 (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)

Group: General Forum Members
Points: 96201 Visits: 13906
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 (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: 162311 Visits: 21422
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 (8.6K reputation)SSCrazy Eights (8.6K reputation)SSCrazy Eights (8.6K reputation)SSCrazy Eights (8.6K reputation)SSCrazy Eights (8.6K reputation)SSCrazy Eights (8.6K reputation)SSCrazy Eights (8.6K reputation)SSCrazy Eights (8.6K reputation)

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

Group: General Forum Members
Points: 158102 Visits: 22523
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