-- =============================================
-- Author:		扎俊
-- Create date: 2018-07-18
-- Description:	判断是否为工作日的函数
-- =============================================
ALTER FUNCTION  isWeekend 
(
	@Day datetime
)
RETURNS bit
AS
BEGIN
	-- Declare the return variable here
	DECLARE @ResultVar bit

	if datediff(d,'1900-01-01',@Day) % 7 >4 
	 set @ResultVar=1
	else
	 set @ResultVar=0
	
	RETURN @ResultVar
END