Date Calendar

  • I am actually working on "holiday logic" for the next version. 🙂

  • Gracias !!! Un muy buen trabajo...

  • Gracias!

  • Hey Sean, I still use this wonderful program at work! Last year I added a is_workday column to flag for holidays. And created a script to generate the holidays for me. I can email it to you if you want it. 😀

    [font="Courier New"]____________________________________________________________________________________________
    Remember as you walk down lifes road, don't forget to stop and pee on the bushes - Thordog
    [/font]

  • Yes, please do! 🙂

  • Quick FYI:

    I've added a few more calculations (should be online soon, the code changes are just "awaiting approval" from SQLServerCentral):

    is_last_day_in_month: is the date value the last day of the month (0)

    first_day_in_quarter: first day of the quarter (2009-10-01 00:00:00.000)

    last_day_in_quarter: last day of the quarter (2009-12-31 00:00:00.000)

    is_last_day_in_quarter: is the date value the last day of the quarter (0)

    week_of_quarter: week of the quarter (2)

    days_in_quarter: total days in the quarter (92)

    quarter_days_remaining: number of days remaining in the quarter (86)

    quarter_days_completed: number of days completed in the quarter (6)

    weekdays_in_quarter: number of weekdays in the the quarter (66)

    quarter_weekdays_remaining: number of weekdays remaining in the quarter (62)

    quarter_weekdays_completed: number of weekdays completed in the quarter (4)

  • Your script is just ultimate! thanks a ton 😀

  • Excellent.

    I agree with the suggestions on picking up the First Day of Week from the SQL Server settings. It's got everything except phases of the moons and high-tide / low-tide based on geocodes. 😛

  • LOL! Maybe I'll add those next. 😉

  • Hi Sean,

    I love the script! Did these get added?

    ...and for my little (very little) contribution, I would add an ISO date field (e.g., 20091006)

    convert(varchar(10), getdate(), 112)

    Sean Smith-776614 (6/29/2010)


    Quick FYI:

    I've added a few more calculations (should be online soon, the code changes are just "awaiting approval" from SQLServerCentral):

    is_last_day_in_month: is the date value the last day of the month (0)

    first_day_in_quarter: first day of the quarter (2009-10-01 00:00:00.000)

    last_day_in_quarter: last day of the quarter (2009-12-31 00:00:00.000)

    is_last_day_in_quarter: is the date value the last day of the quarter (0)

    week_of_quarter: week of the quarter (2)

    days_in_quarter: total days in the quarter (92)

    quarter_days_remaining: number of days remaining in the quarter (86)

    quarter_days_completed: number of days completed in the quarter (6)

    weekdays_in_quarter: number of weekdays in the the quarter (66)

    quarter_weekdays_remaining: number of weekdays remaining in the quarter (62)

    quarter_weekdays_completed: number of weekdays completed in the quarter (4)

  • Yes indeed. All of the quarterly calculations are now there in the script. 🙂

  • Thank you, sir! Sorry, I didn't bother to check the script 😉

  • Hi Sean,

    I love the script! Did these get added?

    ...and for my little (very little) contribution, I would add an ISO date field (e.g., 20091006)

    convert(varchar(10), getdate(), 112)

    Why varchar(10) and not char(8)? Does ISO date require that (I don't know)?


    Cursors are useful if you don't know SQL

  • No, it is just a string. I put varchar(10) due to force of habit... char(8) is fine, and better.

    mstjean (7/21/2010)


    Hi Sean,

    I love the script! Did these get added?

    ...and for my little (very little) contribution, I would add an ISO date field (e.g., 20091006)

    convert(varchar(10), getdate(), 112)

    Why varchar(10) and not char(8)? Does ISO date require that (I don't know)?

  • I just inner joined the table and saw the power!!!

    Great idea and amazing script.

Viewing 15 posts - 16 through 30 (of 71 total)

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