Working days of the month RRS feed

  • Question

  • Hi there,

    I am just wondering how do we find out working days of the month? it is easy to exclude sat and sunday but the problem is Bank holiday. I am in UK so it is only 8 bank holiday in particular month. Is there any logic to do it?

    I can think of creating one table with entry of bank holiday and exclude them. any other suggestion?

    Wednesday, August 5, 2009 11:33 AM


All replies

  • That is a fair way of doing it.  You might want to give a look at a write-up on a calendar table here:


    Here are some other posts that might be helpful / related:

          Umachandar Jayachandran

          Louis Davidson's Blog for loading a calendar table

          Louis Davidson
          Kent Waldrop

          Louis Davidson


             Umachandar Jayachandran
    Wednesday, August 5, 2009 11:37 AM
  • Use an auxiliary table.

    Wednesday, August 5, 2009 11:38 AM
  • Yes it is good idea to create bankholiday table and save daynumber in that table.

    but you have fix days as bank holiday then you might use query to exclude those

    Shamas Saeed MCITP-DBD 2005 http://sqlservercoollinks.blogspot.com
    Wednesday, August 5, 2009 11:39 AM
  • Hi Vijay

    A Holiday table is a very common way of dealing with this requirement, particularly where you have an international element to your data. ie if you need to figure out if it's a holiday in the UK or US etc.

    A number table is also convenient for calculating the number of working days in a date range.

    Itzik Ben-Gan recommends the Richard T. Snodgrass book Developing Time-Oriented Database Applications in SQL, available in pdf at http://www.cs.arizona.edu/~rts/publications.html 



    If you have found this post helpful, please click the 'Vote as Helpful' link (the green triangle and number on the top-left).

    If this post answers your question, click the 'Mark As Answered' link below. It helps others who experience the same issue in future to find the solution.
    Wednesday, August 5, 2009 11:44 AM
  • http://sqlserver2000.databases.aspfaq.com/why-should-i-consider-using-an-auxiliary-calendar-table.html

    this link is useful but all bank holiday is for USA...is there something availble for UK dates?
    Wednesday, August 5, 2009 11:56 AM
  • Yes, you can get the UK holiday dates from the following resources and populate your calendar table:
    Plamen Ratchev
    • Marked as answer by Zongqing Li Wednesday, August 12, 2009 6:33 AM
    Wednesday, August 5, 2009 12:50 PM