Day-of-week to Week-Number mapping

  • 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?

    _____________
    Code for TallyGenerator

  • Cross Join with a list of weeks?  Don't forget to compensate for laundry day offsets. ๐Ÿ˜‰

    --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.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Move to FL and just wear flip flops... problem solved. :hehe:

  • 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

  • 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!

    _____________
    Code for TallyGenerator

  • 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

  • Just buy socks from one day of the week.

    412-977-3526 call/text

  • 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

Viewing 8 posts - 1 through 7 (of 7 total)

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