Calendar For the Fiscal Year

  • Hi all

    Need a function to generate the no. of working days in the Fiscal Year

    Thanks

    Alok

  • Create a calendar table with a row for each date, and include a column that indicates if a date is a working day or not.

    Then you can just run a query in the function to count the days that are working days.

  • Excellent article here on SSC

    4-4-5 Calendar Functions, Part 1

    By Cliff Corder, 2010/09/06 (first published: 2009/09/28)

    http://www.sqlservercentral.com/articles/function/67046/

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • Michael Valentine Jones (7/5/2012)


    Create a calendar table with a row for each date, and include a column that indicates if a date is a working day or not.

    Then you can just run a query in the function to count the days that are working days.

    I think that would be an awful lot of manual work. The table would require a lot of updating.

    Then again, OP, are you accounting for Snow Days, Hurricane Days, etc.?

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Brandie Tarvin (7/5/2012)


    Michael Valentine Jones (7/5/2012)


    Create a calendar table with a row for each date, and include a column that indicates if a date is a working day or not.

    Then you can just run a query in the function to count the days that are working days.

    I think that would be an awful lot of manual work. The table would require a lot of updating.

    Then again, OP, are you accounting for Snow Days, Hurricane Days, etc.?

    I am not sure how you can say it would be a lot of manual work, since the OP supplied absolutely no information on how their fiscal year and working days are defined.

    It's possible that the table could be populated with a simple algorithim, but who knows?

    Since the definition of fiscal year and working day varies widely from one organization to another, I doubt anyone can supply a more specific answer without additional information from the OP.

  • Michael Valentine Jones (7/5/2012)


    Brandie Tarvin (7/5/2012)


    Michael Valentine Jones (7/5/2012)


    Create a calendar table with a row for each date, and include a column that indicates if a date is a working day or not.

    Then you can just run a query in the function to count the days that are working days.

    I think that would be an awful lot of manual work. The table would require a lot of updating.

    Then again, OP, are you accounting for Snow Days, Hurricane Days, etc.?

    I am not sure how you can say it would be a lot of manual work, since the OP supplied absolutely no information on how their fiscal year and working days are defined.

    Speaking from experience, your suggestion of creating a table is not a "load and forget" kind of thing. Even assuming that the OP loads the table with every date in existence when he first creates the table, he then has to have a regular maintenance task on his calendar at least once a year, if not several times a month, to fix items that have changed. Most workplaces only notify people of company holidays a month in advance of a new year, then you have days where the office gets closed due to natural disasters (snow days, hurricane closures, fires, etc.), and then days where a weekend suddenly becomes a working day.

    It is a headache of maintenance. We have a similar kind of table at my workplace which I dislike intensely because now it's migrated into 3 different systems, which means I have to do 3 times the work to maintain it.

    But, the OP may be forced to do the maintenance regardless of whatever choice he makes on a solution. The more I think about it, the less I can see a way around the "fixing".

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

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

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