Re: Holidays in SQL Server

From: Aaron Bertrand [MVP] (aaron_at_TRASHaspfaq.com)
Date: 02/28/04


Date: Sat, 28 Feb 2004 12:10:41 -0500

Use a calendar table. See the "more advanced example" at
http://www.aspfaq.com/2453

-- 
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Nils Magnus Englund" <nils.magnus.englund@orkfin.no> wrote in message
news:ujHI8Za$DHA.808@TK2MSFTNGP12.phx.gbl...
> Hi!
>
> I have a large table in SQL Server 2000 with a datetime-column 'dt'. I
want
> to select all rows from that table, excluding days which fall on holidays
or
> weekends. What is the best way to accomplish this? I considered creating a
> new table called "holidays" and then selecting all rows (sort of "where
not
> in (select * from holidays)") , but I was looking for a better solution
> since that implies that I have to populate the "holidays" table.
>
> Suggestions are welcome!
>
>
> Sincerely,
> Nils Magnus Englund
>
>


Relevant Pages

  • Re: Holidays in SQL Server
    ... SQL Server Programmer ... "Nils Magnus Englund" wrote in message ... > I have a large table in SQL Server 2000 with a datetime-column 'dt'. ... > since that implies that I have to populate the "holidays" table. ...
    (microsoft.public.sqlserver.server)
  • Re: Holidays in SQL Server
    ... SQL Server Programmer ... "Nils Magnus Englund" wrote in message ... > I have a large table in SQL Server 2000 with a datetime-column 'dt'. ... > since that implies that I have to populate the "holidays" table. ...
    (microsoft.public.sqlserver.tools)
  • Re: Holidays in SQL Server
    ... SQL Server MVP ... "Nils Magnus Englund" wrote in message ... > I have a large table in SQL Server 2000 with a datetime-column 'dt'. ... > since that implies that I have to populate the "holidays" table. ...
    (microsoft.public.sqlserver.tools)
  • Re: Holidays in SQL Server
    ... SQL Server Programmer ... "Nils Magnus Englund" wrote in message ... > I have a large table in SQL Server 2000 with a datetime-column 'dt'. ... > since that implies that I have to populate the "holidays" table. ...
    (microsoft.public.sqlserver.programming)
  • Re: Holidays in SQL Server
    ... SQL Server MVP ... "Nils Magnus Englund" wrote in message ... > I have a large table in SQL Server 2000 with a datetime-column 'dt'. ... > since that implies that I have to populate the "holidays" table. ...
    (microsoft.public.sqlserver.programming)