Finding dates in Dates tally table

  • Michael Valentine Jones (6/16/2011)


    opc.three (6/16/2011)

    ...

    That said, Michael's script has "DATE_ID = Days since 1753-01-01". I am not modeling anything more than 111 years old...was it done this way in the function just for the additional range of dates?

    I did it that way because 1753-01-01 is the earliest possible DATETIME value, and the programming is really no different or more trouble.

    That function was meant to support the widest possible range of applications, so it supports a valid date range of 1754-01-01 through 9997-12-31. I left off a year at the beginning and two years at the end of the possible DATETIME values to make it simpler to program the function, and figured most people could make do with the 8245 year range it does support.

    Dang it...was hoping for something less logical 😀 Thanks.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • tfifield (6/16/2011)


    Jeff Moden (6/14/2011)


    I also thought that opc.three's addition of an instance column was brilliant. I've never had a business case for that, but I'm putting it my tool chest.

    If for nothing else, it makes populating the "IsHoliday" column a whole lot easier (except for Easter and other lunar-cycle-based holidays). It also makes it easy to do things like schedule a regular event (like paydays for example)

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

  • opc.three (6/16/2011)


    Thanks gents Writing? Love to try my hand at it but do not know where to start. I sent you an email.

    Got the email. Working on a response.

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

Viewing 3 posts - 16 through 17 (of 17 total)

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