---注意:这里统计的周末包括周5,周6,但不包括周日ALTER FUNCTION [dbo].[GetWeekDaysByMonth] ( @Year INT, @Month INT, @Day INT ) RETURNS INT AS BEGIN ); , , , ; , , , ), , , )) ); --月天数 ; BEGIN ;---周几 END; ELSE BEGIN SET @weekday = DATEPART(WEEKDAY, @date);---周几 END; BEGIN…