A function to return holidays is a great idea. However, I used this function and found that Nov 24,2008 returns true (1) as a Holiday. November 24 is a Monday, and Thanksgiving is the 4th Thursday in November.

The TSQL can be simplified. My function is below (with some different holiday dates, change as needed). I set variables for the month, day of week, day of month and use those to determine whether the date is a holiday. --==============================================================CREATE FUNCTION [dbo].[udf_DateIsHoliday]( @DateIn datetime)RETURNS bitASBEGINDECLARE @mm tinyint;DECLARE @dw tinyint;DECLARE @dd tinyint;SET @mm = DATEPART(mm,@DateIn);SET @dw = DATEPART(dw,@DateIn);SET @dd = DATEPART(dd,@DateIn);